CoCoA:While

From ApCoCoAWiki

While

loop command

Description

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

Example

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

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

Syntax

While B Do C EndWhile

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

For

Foreach

Repeat

   <type>programming</type>
   <type>loops</type>