4D v14.3

Repeat...Until

Home

 
4D v14.3
Repeat...Until

Repeat...Until  


 

 

The formal syntax of the Repeat...Until control flow structure is:

 Repeat
    statement(s)
 Until(Boolean_Expression)

A Repeat...Until loop is similar to a While...End while loop, except that it tests the Boolean expression after the loop rather than before. Thus, a Repeat...Until loop always executes the loop once, whereas if the Boolean expression is initially False, a While...End while loop does not execute the loop at all.

The other difference with a Repeat...Until loop is that the loop continues until the Boolean expression is TRUE.

Example  

Compare the following example with the example for the While...End while loop. Note that the Boolean expression does not need to be initialized—there is no CONFIRM command to initialize the OK variable.

 Repeat
    ADD RECORD([aTable])
 Until(OK=0)

 
PROPERTIES 

Product: 4D
Theme: Language definition

 
SEE ALSO 

Case of...Else...End case
Control Flow
For...End for
If...Else...End if
While...End while

 
ARTICLE USAGE

4D Language Reference ( 4D v12.4)
4D Language Reference ( 4D v11 SQL Release 6)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)