|
|
While statementsWhile statements specify the repeated execution of a statement sequence depending on the value of a Boolean expression. The expression is evaluated before each subsequent execution of the statement sequence. The repetition stops as soon as this evaluation yields the value FALSE. WhileStatement = WHILE expression DO StatementSequence END. Examples:
WHILE j > 0 DO
j:= j DIV 2;
i:= i+1
END
WHILE i#j DO
IF 1 > j THEN i : = i-j
ELSE j:= j-i
END
END
WHILE (t # NIL) & (t^.key # i) DO
t : = t^.left
END
Source:
|