EAGLE Help Light

while

The while statement has the general syntax

while (condition) statement
and executes the statement as long as the condition expression is not zero.

The condition is tested before the first possible execution of statement, which means that the statement may never be executed if condition is initially zero.

If there is no break or return inside the statement, the statement must affect the value of the condition, or condition itself must change during evaluation in order to avoid an endless loop.

Příklad


string s = "Trust no one!";
int i = 0;
while (s[i])
      ++i;


OBSAH Translation © 2001 ELCAD v.o.s., Copyright © 2001 CadSoft Computer GmbH