Re: [Ql-Users] Function type error

2017-08-10 Thread Per Witte via Ql-Users
I couldnt resist wading in here. Regarding Michael's original question the Mint% routine should answer.Try this: 100 : 110 a = 330.7: b = 440.7 120 PRINT #0, Min_Int%(a, b), Mint%(a, b) 130 PAUSE -1 140 STOP 150 : 160 DEFine FuNction Min_Int%(x%,i) 170 IF x% < i : RETurn x% : ELSE : RETurn i 180

Re: [Ql-Users] Function type error

2017-08-10 Thread Michael Bulford via Ql-Users
Thanks for your explanations. This is all specific to SBASIC. Tobias gives an example with a LOCal name the same as the function name. Although this is possible, it cannot be recommended. You will not be able to call the function recursively. And it won't compile with either QLiberator or

Re: [Ql-Users] Function type error

2017-08-10 Thread Tobias Fröschle via Ql-Users
The type of a function is not determined by the function name ending in a $ or % sign, but rather by what it returns - You can even write a function STRING% that returns a string or a function a$ that returns an integer value. The name you give your function is simply a hint to yourselves on

Re: [Ql-Users] Function type error

2017-08-10 Thread Dilwyn Jones via Ql-Users
The fact that the function name ends in % doesn't seem to make it an integer function (although the QL user guide says that "the type of data returned by the function is indicated by the type appended to the function identifier") any more than parameter names have no type until they are set,

[Ql-Users] Function type error

2017-08-10 Thread Michael Bulford via Ql-Users
Hi all, I've no idea whether this has been mentioned before, but consider this … 100 :110 PRINT #0, Min_Int%(330.7, 440.7)120 PAUSE -1130 STOP140 :150 DEFine FuNction Min_Int%(x%,i)160  IF x% < i : RETurn x% : ELSE : RETurn i170  END DEFine The correct result should be 331, sincethis is an