Repeat function

Syntax

Repeat
   statement_list
Until logical_expression

Description

Use the Repeat loop to cause the statements in statement_list to be repeated until logical_expression is True. Any kind of statements are allowed in the loop, including other loops. A Break statement inside the loop causes execution to continue with whatever follows the end of the loop. If the Break is in a nested loop, the Break does not apply to the outside loop.

Example

The following example repeats a sequence of statements until a complex Boolean condition is True:

Repeat
   &J = &J + 1;
   &ITEM = FetchValue(LOT_CONTROL_INV.INV_ITEM_ID, &J);
   &LOT = FetchValue(LOT_CONTROL_INV.INV_LOT_ID, &J);
Until (&ITEM = &INV_ITEM_ID And &LOT = &INV_LOT_ID) Or &J = &NUM_LOT_ROWS;