Language Reference |
Executes a statement until a specified condition is false.
The while statement syntax has these parts:
Part Description expression A Boolean expression checked before each iteration of the loop. If expression is true, the loop is executed. If expression is false, the loop is terminated.
statement The statement to be executed if expression is true. Can be a compound statement.
The while statement checks expression before a loop is first executed. If expression is false at this time, the loop is never executed.