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
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
Repeats a block of statements while or until a condition is true.
Syntax 1: Condition evaluated; if True, statementblock executed, and so on
(WHILE); if False, statementblock executed until True (UNTIL).
DO [{WHILE | UNTIL} condition]
[statementblock]
[EXIT DO]
[statementblock]
LOOP
Syntax 2: Statementblock executed, then condition evaluated; if True,
statementblock re-executed, and so on (guaranteed one-time
execution of statements).
DO
[statementblock]
[EXIT DO]
[statementblock]
LOOP[{WHILE | UNTIL} condition]
■ condition Numeric expression that evaluates as True (nonzero)
or False (zero)
■ statementblock One or more valid statements on one or more lines
■ EXIT DO Alternative exit from DO...LOOP; transfers control
to the statement following the LOOP keyword
See Also
◄FOR...NEXT Statement► ◄Loops and Decision Structures►
◄WHILE...WEND Statement►