fastbasic
fastbasic copied to clipboard
partial reserved word matching in variables
Hello. I'm facing errors with certain var names. e.g
u%=0.12
cosu%=cos(u%)
cos4u%=cosu%*cosu%*cosu%*cosu%
u%=90*cos4u%
cannot compile:
BAS compile 'testfloat.bas' to 'testfloat.asm'
testfloat.bas:4:10: parse error, expected: '+', '-'
u%=90*cos4<--- HERE -->u%
all is ok if I rename the variable to c4u%
This is expected, as function with a single parameter can be called without parentheses.
So, cos(4) is the same as cos 4 or cos4 since space is optional. So, it interprets cos4u as cos(4) and doesn't know what to do with u.
Therefore, I recommend you avoid using any variable names that are the name of real function, or the name of a function followed by a number.
Closed as not-a-bug. Have Fun!