LOOP
Syntax
![]()
Command
Mandatory parameter Optional parameter Mandatory keyword Optional keyword |
LOOP
<Code lines>
ENDLOOP
Description
Perpetually executes the code lines in the loop. Execution can only terminated by breaking out of the loop in one of the three following ways.
- With a BREAK command, which breaks out of the loop.
- With a GOTO command that refers to a label outside of the loop
- With an EXIT command, This command exits the current routine and therefore also exits the LOOP.
Diagram
Returned value type
None
Parameters
None
Example
s-month := 1
loop
proc5 ()
s-month += 1
if s-month > 12
break
endif
endloop
loop
proc5 ()
s-month += 1
if s-month > 12
break
endif
endloop