while: wend
#3
"WHILE... WEND" was the only provided way by GW-BASIC to do loops without relying on "GOSUB/RETURN" and "GOTO".

"DO... LOOP" is superior, I had first seen it in Commodore 128 BASIC, in "RUN" magazine. This game I wanted badly on my Tandy1000HX LOL back in the late 1980's. Some guy wrote a book about programming in QuickBASIC, said "WHILE... WEND" was acceptable and otherwise "GOTO" with clear labels, and "DO... LOOP" was too much like Pascal and he didn't like it. To try to make the older construct more useful "EXIT WHILE" was added. That's why now we also have "EXIT SELECT" which is sloppy also.

QuickBASIC didn't have "EXIT WHILE" nor "_CONTINUE", and therefore the only way to create a "run-once" loop was to employ a "DO... LOOP" that purposely fell through at the end such as "LOOP WHILE 0" or "LOOP UNTIL 1". The idea was to be able to use "EXIT DO" to skip a bunch of lines within the false loop according to a condition. See the Wiki example for "DO... LOOP" which I think was one of the most useful to me.

https://qb64phoenix.com/qb64wiki/index.php/DO...LOOP

(Example #3)
Reply


Messages In This Thread
while: wend - by fistfullofnails - 01-03-2023, 06:09 AM
RE: while: wend - by SMcNeill - 01-03-2023, 06:28 AM
RE: while: wend - by mnrvovrfc - 01-03-2023, 07:56 AM
RE: while: wend - by bplus - 01-03-2023, 03:39 PM
RE: while: wend - by mnrvovrfc - 01-03-2023, 07:54 PM
RE: while: wend - by bplus - 01-03-2023, 03:57 PM
RE: while: wend - by james2464 - 01-03-2023, 04:07 PM
RE: while: wend - by fistfullofnails - 01-05-2023, 07:36 AM
RE: while: wend - by SMcNeill - 01-05-2023, 08:38 AM
RE: while: wend - by Kernelpanic - 01-03-2023, 08:40 PM
RE: while: wend - by TempodiBasic - 01-04-2023, 12:13 AM
RE: while: wend - by bplus - 01-04-2023, 01:09 AM
RE: while: wend - by bplus - 01-04-2023, 01:55 AM
RE: while: wend - by SMcNeill - 01-04-2023, 02:52 AM
RE: while: wend - by bplus - 01-04-2023, 04:12 AM
RE: while: wend - by mnrvovrfc - 01-04-2023, 04:51 AM
RE: while: wend - by bplus - 01-04-2023, 05:22 PM
RE: while: wend - by Kernelpanic - 01-05-2023, 12:26 PM
RE: while: wend - by TerryRitchie - 01-05-2023, 04:55 PM
RE: while: wend - by TempodiBasic - 01-05-2023, 06:36 PM
RE: while: wend - by TerryRitchie - 01-05-2023, 11:04 PM
RE: while: wend - by fistfullofnails - 01-07-2023, 05:12 AM
RE: while: wend - by SMcNeill - 01-07-2023, 06:51 AM
RE: while: wend - by mnrvovrfc - 01-07-2023, 06:29 AM
RE: while: wend - by OldMoses - 01-07-2023, 01:55 PM



Users browsing this thread: 16 Guest(s)