Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use LOOPs to avoid excessive RETURNs
#2
This tip is good. I would add a comment on the line with "DO" that it will execute once on purpose. Either that, or "DO" or "LOOP" having "UNTIL 1" or "WHILE 0" after it and without the obligatory "EXIT DO" as the last statement controlled by the so-called loop.

While QB64 lacked "_CONTINUE" I learned a valuable tip on the Wiki page for "DO... LOOP" to emulate it. I had written a "preprocessor" having a few invented keywords, put in functionality like "_CONTINUE" that was translated into "IF condition THEN GOTO CONTINUE001" but it didn't work very well because it made a few assumptions. I abandoned my "preprocessor" after I discovered the tip on Wiki.
Reply


Messages In This Thread
Use LOOPs to avoid excessive RETURNs - by Pete - 09-12-2022, 03:28 PM
RE: Use LOOPs to avoid excessive RETURNs - by mnrvovrfc - 09-12-2022, 05:06 PM



Users browsing this thread: 1 Guest(s)