bas7advr.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 Details
  Syntax  Details  Example                 Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
DO...LOOP repeats a block of statements while a condition is true or
until a condition becomes true.
 
Syntax 1
  DO [{WHILE | UNTIL} condition]
      [statementblock]
  [EXIT DO]
      [statementblock]
  LOOP
 
Syntax 2
  DO
      [statementblock]
  [EXIT DO]
      [statementblock]
  LOOP [{WHILE | UNTIL} condition]
 
    ■ EXIT DO is an alternative exit from a DO...LOOP. EXIT DO
      transfers control to the statement following the LOOP statement.
      When used within nested DO...LOOP statements, EXIT DO transfers out
      of the immediately enclosing loop. EXIT DO can be used only in a
      DO...LOOP statement.
 
Usage Notes
    ■ You can use a DO...LOOP statement instead of a WHILE...WEND
      statement. The DO...LOOP is more versatile because it can test
      for a condition at the beginning or at the end of a loop.