100BBasic instructions
7.8 Program control
S7-1200 Programmable controller
214
System Manual, 11/2011, A5E02486680-05
7.8.6
REPEAT-UNTIL statement
Table 7- 101 REPEAT instruction
SCL
Description
REPEAT
Statement;
;
UNTIL "condition"
END_REPEAT
The REPEAT statement executes a group of statements until a given condition is
TRUE.
You can nest REPEAT loops. The END_REPEAT statement always refers to the last
executed Repeat instruction.
Table 7- 102 Parameters
Parameter
Description
Statement
Optional. One or more statements that are executed until the condition is TRUE.
"condition"
Required. One or more expressions of the two following ways: A numeric expression or string
expression that evaluates to TRUE or FALSE. A "null" condition is interpreted as FALSE.
Note
Before evaluating the state of "condition", the REPEAT statement executes the statements
during the first iteration of the loop (even if "condition" is FALSE). To review the state of
"condition" before executing the statements, use the WHILE statement.
To end the loop regardless of the state of the "condition" expression, use the EXIT statement
(Page 215). The EXIT statement executes the statement immediately following the
END_REPEAT statement
Use the CONTINUE statement (Page 214) to skip the subsequent statements of a REPEAT
loop and to continue the loop with the examination of whether the condition is met for
termination.
7.8.7
CONTINUE statement
Table 7- 103 CONTINUE statement
SCL
Description
CONTINUE
Statement;
;
The CONTINUE statement skips the subsequent statements of a program loop (FOR,
WHILE, REPEAT) and continues the loop with the examination of whether the condition is
met for termination. If this is not the case, the loop continues.