up previous next
While

loop command
Syntax

While B Do C EndWhile

where B is a boolean expression and C is a sequence of commands.


Description
The command sequence C is repeated until B evaluates to FALSE.

Example
  N := 0;
  While N <= 5 Do
    PrintLn 2, "^", N, " = ", 2^N;
    N := N+1;
  EndWhile;
2^0 = 1
2^1 = 2
2^2 = 4
2^3 = 8
2^4 = 16
2^5 = 32

-------------------------------


See Also