Hi
this example provides 2 different output in debug mode and in normal mode.
This problem has made me crazy in the vector font program that I'm writing
Ciao
Qedo
// Project: bug
// Start: Tuesday, August 16, 2016
// IDE Version: 14.329
a=0
IF a<>0 THEN
a=a-100
PRINT a , 10,10
SHOWSCREEN
MOUSEWAIT
do you mean
a=0
IF a<>0 THEN a=a-100
PRINT a , 10,10
SHOWSCREEN
MOUSEWAIT
it outputs 0 as i would expect
To be honest, it shouldn't actually compile at all, as the ENDIF statement is missing.
The difference is because debug mode adds in extra lines on every other line, which release mode does not.
In debug mode, it would look something like :
ON_DEBUG(1)
a=0
ON_DEBUG(2)
if a<>0 then
ON_DEBUG(3)
a=a-100
ON_DEBUG(4)
and so on, making it appear that the code works "correctly"
As mentioned previously you could either use if a<>0 then a=a-100
or
if a<>0
a=a-100
endif
Beside that I would always advise to strictly declare your variables, to avoid any strange float to int comparisons.
And indent!
In the example I reported there are two problems:
1) how to properly reported by MrTAToad the program should not compile as the ENDIF statement is missing.
2) Despite compiles in any case, the result is different from release (a = -100) to debug mode (a = 0). Perhaps it is the consequence of point 1
There are not declaration problems or strange float to int comparisons.
In fact, even declaring the variable (GLOBAL a%) the bug (if it exists) remains.
I suspect the program compiles (when it shouldn't) because the on_debug function is being added to the THEN line.
The reason a is different in the two modes is because of the above.