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 Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
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]
Usage Notes
■ EXIT DO can be used only in a DO...LOOP statement.
■ When EXIT DO is used within nested DO...LOOP statements, control is
transferred out of the immediately enclosing loop.
■ You can use a DO...LOOP statement instead of a WHILE...WEND
statement. DO...LOOP is more versatile than WHILE...WEND because it can
test for condition at the beginning or at the end of a loop.