Specifications

Section 9. Program Control Instructions
9-22
Remarks
While…Wend loops can be nested.
The While...Wend statement has the following parameters:
While The While statement begins the While...Wend loop control
structure.
Condition The Condition is any expression that can be evaluated True
(nonzero) or False (0 and Null). If Condition is true, all
statements in StatementBlock are executed until the Wend
statement is encountered. Control then returns to the While
statement and Condition is again checked. If Condition is
still true, the process is repeated. If Condition it is not True,
execution resumes with the statement following the Wend
statement.
StatementBlock The StatementBlock is the portion of the program that
should be repeated until the loop is terminated. These
instructions lie between the While and Wend statements.
Wend The Wend statement ends the While...Wend control
structure.
The Do...Loop provides another way to perform looping.
While...Wend Statement Example
This example creates a While...Wend that is exited only if Reply is within a
range.
Dim Reply 'Declare variable.
While Reply < 90
Reply = Reply + 1
Wend
NOTE