While Statement



next up previous contents index
Next: For Statement Up: Statements Previous: If Statement

While Statement

The while statement has the form
while <expr> do <body> end
Its effect is to execute the body repeatedly as long as the expression remains true. The expression must be of type "bool". If the value of the expression is true, the body is executed, and then the entire while statement is executed again. When the expression evaluates to false, execution of the while statement terminates.



theta-questions@lcs.mit.edu