There's a little bug in the internal autocast when used in a IF condition.
I got a function "GetParameter()" in my program. It will search for a substring inside an other string and it tries to extract the parameter that follows the substring, eg:
Return Type must be string, cause it's a generic function that allows to return any parameter.
Now here's the problem: using this
Where the if line says it is not zero, myvar will read it as zero. This will of course result in hard to find bugs, eg. when used as an optional ScaleTexture parameter.
Although, it's easy to prevent these troubles when you use the IF statement like this instead:
If Float(GetParameter(c$,"height:"))<>0
I got a function "GetParameter()" in my program. It will search for a substring inside an other string and it tries to extract the parameter that follows the substring, eg:
c$ = "object:123 height:55.4" ;and it's used this way: Print GetParameter(c$,"height:") ;-------- Function GetParameter$(cmd$,sub$) if the substring can't be found at all, then return right here: Return "" endif ;... extract and return parameter of "height:" return param$ end function
Return Type must be string, cause it's a generic function that allows to return any parameter.
Now here's the problem: using this
If GetParameter(c$,"height:")<>0 myvar#=GetParameter(c$,"height:") else myvar#=0 endif
Where the if line says it is not zero, myvar will read it as zero. This will of course result in hard to find bugs, eg. when used as an optional ScaleTexture parameter.
Although, it's easy to prevent these troubles when you use the IF statement like this instead:
If Float(GetParameter(c$,"height:"))<>0