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