4D v16.3

Repeat...Until

Home

 
4D v16.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)



See also 

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

 
PROPERTIES 

Product: 4D
Theme: Language definition

 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)