Author Topic: Double Check on order of operations  (Read 5913 times)

0 Members and 1 Guest are viewing this topic.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Double Check on order of operations
« Reply #15 on: January 30, 2022, 05:53:16 pm »
I bet this is an old feature of the original BASIC.

You'd be right on that bet, as I just illustrated above.



Quote
I think that for QB64 to work the way many other languages work, maybe it needs to change, or provide a compiler directive to tell it to perform order of operations the way most other languages do it. It would improve QB64.

No -- it'd destroy the main goal of the QB64 project: To allow old BASIC code to run and compile on modern systems.  Being QB45 compatible is our number one baseline, so people can port old programs over with minimal alteration needed.

If you need a different order of operations than the one which has been standard in BASIC for the last 50 years, then you'll need to either manually set precedence with parentheses, or choose a different language like Python, Java, or Cobol.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!