QBasic 1.1: LOOP Keyword
Explanation
DO...LOOP Statement
Repeats a block of statements while a condition is true or until a condition becomes true.
Worth knowing
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
Syntax
DO [{WHILE | UNTIL} condition]
[statementblock]
LOOP
|
DO
[statementblock]
LOOP [{WHILE | UNTIL} condition]
|
Description / Parameter(s)
condition |
A numeric expression that Basic evaluates as true (nonzero) or false (zero). |
Example
i% = 0
PRINT "Value of i% at beginning of loop is "; i%
DO WHILE i% < 10
i% = i% + 1
LOOP
PRINT "Value of i% at end of loop is "; i%