CONTINUE
Syntax
![]()
Command
Mandatory parameter Optional parameter Mandatory keyword Optional keyword |
CONTINUE
Description
Used in loops. The code after the CONTINUE command in the loop will be skipped and the next iteration will be started directly. In a For loop the for-loop counter will be increased.
Diagram
N.A.
Returned value type
None
Parameters
None
Remarks
This command can be used inside the following types of loops.
- For loops
- While loops
- Tablequery loops
- Freequery loops
- Storedprocedure loops
- Readfile loops
- Compare loops
When using a loop-counter to its full extent (i.e. loop for i := 1 to 99 for a numeric 2) the continue statement will result in an endless loop, since the counter will be increased by one and the check will be omitted. Value 99 will then increase to 100 which is 00 for a numeric 2. |
Examples
In the shown examples the last three iterations 8, 9 and 10 will send a message to the log.
// continue in a for loop
loop for i := 1 to 10
if i < 8
continue
endif
sme ('For loop counting i is: ' + i)
endloop
loop for i := 1 to 10
if i < 8
continue
endif
sme ('For loop counting i is: ' + i)
endloop
// continue in a while loop
i := 0
loop while i < 10
i := i + 1
if i < 8
continue
endif
sme ('While loop counting i is: ' + i)
endloop
i := 0
loop while i < 10
i := i + 1
if i < 8
continue
endif
sme ('While loop counting i is: ' + i)
endloop