03-04-2011, 12:48 PM
Okay, I remember. It's not a bug.
If you call a function in advance (not being declared yet) the compiler will asume it's a FLOAT function. You have to use DECLARE, to declare the function header in advance (like in C):
If you don't use DECLARE, everything (parmeters and return type) are supposed to be Float. So, the BUG in the compiler is the compiler should complain that your later function declaration doesn't match the expected return type.
If you call a function in advance (not being declared yet) the compiler will asume it's a FLOAT function. You have to use DECLARE, to declare the function header in advance (like in C):
Code:
declare function test(n as Ubyte) as String
dim result as STRING
result = test(50)
print result
function test(n as UBYTE) as STRING
return str(n)
end function