01-03-2023, 07:54 PM
(01-03-2023, 03:39 PM)bplus Wrote: "WHILE... WEND" was the only provided way by GW-BASIC to do loops without relying on "GOSUB/RETURN" and "GOTO".
Nope! For... Next was in there first even before While... Wend
Nobody was going to use a "FOR... NEXT" loop to create what looked like an infinite loop. I stand corrected, because some people forced a much longer loop than was set in "FOR" statement by simply setting the loop variable so it never reached the destination...
This creates an endless loop:
Code: (Select All)
FOR t = 1 to 10
t = 1
'rest of loop code
NEXT t
Also "FOR... NEXT" always required a variable, although breaking out of an endless "WHILE... WEND" needed to test something. Anyway I was trying to emphasize that "DO... LOOP" was presented later as an alternative away from 8-bit computers having BASIC interpreters.