Do [While c|Until c]
   statements
 Loop [While c|Until c]

Executes the statements in a loop. Loop conditions can be put at the top of the loop, or at the bottom, or even both. The top (Do) condition is checked before each iteration and determines whether the iteration begins. The bottom (Loop) condition is checked after each iteration and determines whether another iteration is tried.

The conditions (c) evaluate to bool. A While condition expects a True result to enter/continue the loop, a Until condition expects a False result.

If no condition is specified, the loop runs infinitely and can only be stopped with Break.

See also: Break, Continue, For, Elementary Commands