QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: Pete on April 10, 2021, 01:18:03 pm
-
Well, maybe not that big of a deal, but riddle me this guys. Why does the QB64 IDE except this???
Naturally, it won't compile. It should throw an IDE error, but it doesn't. It just gives the OK!
This occurs in both in Versions 1.3 and 1.5, so my guess is it just has never been discovered before.
Pete
-
But why would you do this? I don't see how that could be accounted for when no one could expect that sort of syntax misuse
-
So instead of...
nexti% = -nexti% s
...let's say you write...
nexti% = -nexti% s s
Now it sends a proper error message, telling the user it expects an operator in the equation.
So how did I stumble on this monumental find you ask? Well, sometimes I use bookmarks but sometimes I just type "s" on a line by itself, when working on a large project. That way, I can go through the code, and quickly return to my work area, by using the IDE error message "jump there" to go back to my work area. So today I got lazy, and typed the "s" on a code line, figuring it would error out the same. I was surprised when it didn't.
Pete
-
Ah! I see! Using a syntax error as a bookmark is clever!
-
It's odd you need the - sign to make it NOT error.
Also
does NOT error either
-
It's odd you need the - sign to make it NOT error.
Also
does NOT error either
Well, you need to make that nexti%, instead of next%, as that is a reserved word. Also, If you do a carriage return, you will see the IDE puts the negative sign next to the variable, automatically.
You did inspire me to look further, as that negative sign has something to do with it.
For example. It wrongly accepts...
Biden = -b s
but properly flags...
Biden = b s
Pete
-
Who knew the IDE was a Biden fan ;-))
-
I know that fan. It's the one that Schiff hit.
Pete