DO and END – Block and Loop commands
Use the DO
and END
commands
to designate a block of code to run together. You can either use them
to group multiple commands for IF
-THEN
-ELSE
or
to repeat blocks of code.
The following list shows the variants of the
DO
commands:Block
- A single run block of code:
DO
Repeat
- A simple repeating block:
DO x
Iterative
- A block that increments or decrements a variable:
DO v = x TO y BY z
While
- A block that runs only while a condition is true:
DO WHILE expression
Until
- A block that runs until a condition is true:
DO UNTIL expression
Forever
- A block that runs until
orLEAVE
EXIT
is run.