This 'bug' is pretty bad, it affects all GLBasic just now, here is an example from the 3D Entity lib, causing programs ONLY to work properly in debug mode.
Here is an example...
FUNCTION EntityLoadTexture: filename$
LOCAL t, sx, sy
t = GENSPRITE()
LOADSPRITE filename$, t
GETSPRITESIZE t, sx, sy
IF sx = 0 THEN DEBUG "failed to load: "+filename$+"\n"
RETURN t
ENDFUNCTION
Now, in debug mode, the above code works fine BUT when not in debug mode the DEBUG command is removed, I guess by the pre-compiler and the next line is used for the THEN statemant.
So I think this is compiled actually compiled...
FUNCTION EntityLoadTexture: filename$
LOCAL t, sx, sy
t = GENSPRITE()
LOADSPRITE filename$, t
GETSPRITESIZE t, sx, sy
IF sx = 0 THEN RETURN t // Grabbed from next line
ENDFUNCTION
So in debug mode the code works fine and returns a texture ID, when not in debug mode, it never gets to the "RETURN t" and always returns 0.
Another even simpler example...
a=a+1
IF a<100 THEN DEBUG "asddasdasd"
PRINT "I'm here!", 0,20
Try these lines with DEBUG on and then with DEBUG off, with off, the PRINT will die in non-debug mode.
I know how to avoid the bug, I have posted about it in the past but its catching other people out, none the less. I personally use the preprocessor to avoid this kind of thing altogether.
At its simplest, it really should not happen, one line merging into another just because you turned off the debugger, this in essence is what should be fixed.
Yes, I had run into that a while ago... =D
dude, that's a nasty one.
I'll fix it in the next update.