While condition Do statement[:statements...]
While condition [Do]
Wend | End While
Executes a series of statements as long as a given condition is not zero (True)
Loop-block begins with While and ends with Wend or equivalently with End While keywords.
While...Wend loops can be nested to any level.
Each Wend (End While) matches the most recent While.
The While-loop statement syntax has these parts:
- condition : Numeric expression or string expression that evaluates to True or False.
- statements : Optional. One or more statements executed while condition is True.
- Exit While : Optional. Transfers control out of the While-Loop block.
Print "j=";Int(j); " i=";Int(i)
If i>1 then Exit While : 'Break loop when i=2