The While statement conditionally executes nested statements, depending on the condition, zero or more times.
while-statement:
While boolean-expression Do block End While
The statement is executed as follows:
An expression in the cycle condition is calculated.
If the expression is set to True, the control is passed to the block of nested statements. After block execution is finished (it is possible as a result of executing the Continue statement) control is passed to the beginning of the statement.
If the expression is set to False, the control is passed to the end point of the statement.
Within the nested statement block of the While statement one can use the Break statement to immediately pass control to the end point of the While statement, and the Continue statement to pass control to the end point of nested statements.
Private Sub TestWhile();
Var
b: boolean;
Begin
b := True;
While b Do
If < Condition of exiting cycle > Then
b := False;
End If;
End While;
End Sub;
See also: