Initial Variable Assignment Bug
Posted: Sat Aug 20, 2016 12:30 pm
Previous posts have noted that ALL variables appear to be assigned string status initially - but it's a bit more complicated than that!
results in: "Comparaison between string and number!" on lines 2 and 3.
gives the same error on lines 2, 4 and 5. However...
results in "The same!" (ie the correct result)
According to the latest documentation,
Clearly this is not the case!
Phil
Code: Select all
x=27
y=27
if x=y then print "The same!" else print "Different!"
end
results in: "Comparaison between string and number!" on lines 2 and 3.
Code: Select all
x=0
y=0
x=27
y=27
if x=y then print "The same!" else print "Different!"
end
gives the same error on lines 2, 4 and 5. However...
Code: Select all
x = 27
y = 27
if x=y then print "The same!" else print "Different!"
end
results in "The same!" (ie the correct result)
According to the latest documentation,
Spaces are don’t care :
A = 5 + 3 is the same as a=5+3
Clearly this is not the case!
Phil