Description
Marks the beginning of a group of statements, where the group is to be executed repeatedly, until the test expression is satisfied.
Syntax
Loop
[statements]
[While test] [Do]
[statements]
[Until test] [Do]
[statements]
Repeat
Parameters
The Loop statement has the following parameters.
Parameter | Description |
---|---|
statements | Any statements that follow Loop are initially executed, and then any While or Until test is evaluated to determine whether its value is true (non-zero) or false (zero). |
test | An expression that equates to a Boolean value ¾ true (non-zero) or false (zero). |
Until | If the Until format is used and the test evaluates to non-zero, the program control passes immediately out of the loop to the next statement after Repeat. But as long as the test evaluates to false, that is, until a certain specification has been met, the program will continue to loop. Loop While true.
|
Remarks
The Do following the Until and While statements is optional. You may use any number of Until and While tests in a single Loop...Repeat structure.