qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DO...LOOP Statement
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
Repeats a block of statements while a condition is true or until a condition
becomes true.
 
DO [{WHILE | UNTIL} condition]
    [statementblock]
LOOP
 
DO
    [statementblock]
LOOP [{WHILE | UNTIL} condition]
 
    ■ 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%
 
See Also    EXIT    FOR...NEXT    WHILE...WEND