Executes a series of statements as long as a given condition is TRUE.
When the condition is TRUE, all statements are executed until the ENDWHILE statement is encountered. When ENDWHILE is reached, control then returns to the WHILE statement where the condition is checked again. If condition is still TRUE, the process is repeated. When the condition is not TRUE, execution resumes with the statement following the ENDWHILE statement.
Unlike the FOR statement, the WHILE statement evaluates condition on every loop pass.
Syntax: |
---|
WHILE condition |
Parameter: |
Description: |
---|---|
condition |
Expression that evaluates to TRUE or FALSE. |
[statements] |
One or more statements executed while condition is True. |
Example: |
---|
VARIABLES: a TYPE: Integer |
Returns: |
Example shows how to repeat a process by looping back over the values until a condition is no longer True. |
Edit Time: 9/26/2020 2:44:18 PM |
Topic ID#: 649 |