WHILE program instruction WHILE program instruction Syntax WHILE condition DO Function Initiate processing of a WHILE structure if the condition is TRUE or skipping of the WHILE structure if the condition is initially FALSE. Usage Considerations Every WHILE statement must be part of a complete WHILE ... DO ... END structure. Parameter condition Real-valued expression that is evaluated and tested for a TRUE (nonzero) or FALSE (zero) value. Details This structure provides another means for executing a group of instructions until a control condition is satisfied (compare it with the DO structure).
The complete syntax for the WHILE structure is WHILE condition DO group_of_steps END Processing of the WHILE structure can be described as follows: 1. Evaluate the condition . If the result is FALSE, proceed to item 4. 2. Execute the group_of_steps. 3. Return to item 1. Unlike the DO structure described elsewhere, the group of instructions within the WHILE structure may not be executed at all. That is, if the condition has a FALSE value when the WHILE is first executed, then the group of instructions are not executed at all. 4. Continue program execution at the first instruction after the END step.
When this structure is used, it is assumed that some action occurs within the group of enclosed instructions that will change the result of the logical expression from TRUE to FALSE when the structure should be exited. eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 565