WHILE prompt statement

Use the WHILE statement to test a condition and execute statements within the body of the WHILE loop as long as the condition is true.

For condition syntax see IF prompt statement.

Syntax



Example

WHILE var1 < 10  DO
.
.
.
 var1 = var1 + 1;
ENDWHILE

As long as the value of var1 is less than 10, the statements will execute.

Procedure

Use the following procedure to define a WHILE statement:

  1. Selecting the WHILE statement: Click Statements —> Conditional.

    The system displays the Condition Definition window.

  2. Click the button next to WHILE Condition DO, then click condition.

    The system displays the Condition Definition window.

  3. Defining the condition: To define the condition, follow Steps 3 through 7 in the procedure for IF prompt statement.
  4. Adding the statement to the prompt: Click OK.

    The WHILE statement is added to the prompt.

  5. Defining DO statements: Use the Statements menu to define the statement that you want to execute when the WHILE condition is true.
  6. The statement is added to the prompt following the DO keyword.
  7. Repeat Step 5 for each statement to be performed when the WHILE condition is true.