WHILE-WEND
The second type of conditional statement is the WHILE-WEND statement. A WHILE statement
contains an expression that controls the repeated execution of the blocks contained between the
WHILE and WEND statements.
The expression controlling the repetition must contain one of the set of relational operators which
allows the expression to be reduced to either true or false. The expression is evaluated before the
contained blocks are executed. The contained blocks are executed repeatedly as long as the
expression is true. If the expression is false at the beginning the blocks are not executed.
Example: N20 WHILE [[P2*P3]⁄COS[P6]] LT P2
N21 P6 = P6 + 1
N22 Y[P2] Z[P3]
N23 X[P6]
N24 X1 Y0 Z0
N25 WEND
N26 M30
In this example lines N20 thru N25 will be repeated until the WHILE expression becomes false.
Then line N26 will be executed instead of N21.
Note: Nested WHILE loops are allowed.