QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: SMcNeill on August 10, 2019, 02:08:06 pm
-
The IDE needs some work with finding and error trapping NOT glitches. You guys would never believe how long it took me to try and decipher this little jewel out of my program:
Needless to say, I've got a variable named oldmouse in my program, and in the rush of coding, I never noticed that I added a space in the name. The IDE doesn't complain over the glitch either, but it does give us a PITA C++ Compilation failed message:
.\\temp\\main.txt:321:65: error: invalid operands of types 'int' and 'int*' to binary 'operator*'
if (((func__mousebutton( 1 ,NULL,0))&(~(*_SUB_PLAYGAME_LONG_OLD)*_SUB_PLAYGAME_LONG_MOUSE))||new_error){
~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
Got to admit, that wasn't exactly the world's most useful message for me, since I'm only a C-hack at best....
The IDE needs a little additional error checking to try and catch these glitches before it compiles them. Other things like just PRINT NOT old mouse produce the same effect, so it's probably an issue with parsing NOT itself which needs looking into.
-
The IDE does have OPTION _EXPLICIT and I am pretty sure OPTION _EXPLICIT would likely catch errors like that.
Man the troubles I imagine it has saved me from since I started using it... specially as my eyes are getting bad.
But NOT logic does offer it's own unique brand of trouble. I've started being explicit x = 0 or x <> 0 and avoid NOT.
Instead of WHILE NOT EOF(1), it is WHILE EOF(1) = 0