DO

language · Also: LOOP

Repeat a block of statements. The condition may be tested on DO and/or on LOOP. With no test, the loop runs until EXIT DO (or BREAK). EXIT DO jumps to the statement after LOOP.

DO [WHILE condition | UNTIL condition] statements EXIT DO LOOP [WHILE condition | UNTIL condition]

condition - expression; WHILE continues while non-zero, UNTIL until non-zero

Example:

I = 0
DO
  I = I + 1
  PRINT I
LOOP UNTIL I = 3
I = 0
DO WHILE I < 3
  I = I + 1
  PRINT I
LOOP
DO
  IF INKEY$() <> "" THEN EXIT DO
LOOP
I = 0
DO
  I = I + 1
LOOP WHILE I < 3

Source: docs/help/do.txt inmmcore. On the computer, typeHELP DO.