Author Topic: Major QB64 bug causing global climate change.  (Read 3297 times)

0 Members and 1 Guest are viewing this topic.

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Major QB64 bug causing global climate change.
« 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???

Code: QB64: [Select]
  1. nexti% = -nexti% s

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
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Major QB64 bug causing global climate change.
« Reply #1 on: April 10, 2021, 01:26:47 pm »
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
Shuwatch!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Major QB64 bug causing global climate change.
« Reply #2 on: April 10, 2021, 01:42:41 pm »
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

Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Major QB64 bug causing global climate change.
« Reply #3 on: April 10, 2021, 01:50:36 pm »
Ah! I see! Using a syntax error as a bookmark is clever!
Shuwatch!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Major QB64 bug causing global climate change.
« Reply #4 on: April 10, 2021, 02:06:19 pm »
It's odd you need the - sign to make it NOT error.

Also
Code: QB64: [Select]
  1. next% = - next% s
does NOT error either

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Major QB64 bug causing global climate change.
« Reply #5 on: April 10, 2021, 03:02:29 pm »
It's odd you need the - sign to make it NOT error.

Also
Code: QB64: [Select]
  1. next% = - next% s
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


Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Major QB64 bug causing global climate change.
« Reply #6 on: April 10, 2021, 03:55:36 pm »
Who knew the IDE was a Biden fan ;-))

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Major QB64 bug causing global climate change.
« Reply #7 on: April 10, 2021, 04:04:31 pm »
I know that fan. It's the one that Schiff hit.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/