‎2010 Jan 20 1:38 PM
Hello,
Could anyone help on how to exit all the loops? I have nested loops like below:
-
LOOP1
LOOP2
LOOP3
Condition.
ENDLOOP3
ENDLOOP2
ENDLOOP1
Other Statements.
-
If the condition is met, how to jump out of all the loops and then the program continues with Other Statements. Is there any direct keyword for this? (like EXIT, CONTINUE)
Thank you,
Yang
‎2010 Jan 20 1:43 PM
Hi,
I don't think we have such fecility. You need to place the checks and exit from the loop.
LOOP1
CLEAR l_flag.
LOOP2
LOOP3
If Condition.satisfied.
l_flag = 1.
EXIT.
endif.
ENDLOOP3
If l_flag = 1.
EXIT.
ENDIF.
ENDLOOP2
If l_flag = 1.
EXIT.
ENDIF.
ENDLOOP1
Thanks,
Vinod.
‎2010 Jan 20 1:43 PM
Hi,
I don't think we have such fecility. You need to place the checks and exit from the loop.
LOOP1
CLEAR l_flag.
LOOP2
LOOP3
If Condition.satisfied.
l_flag = 1.
EXIT.
endif.
ENDLOOP3
If l_flag = 1.
EXIT.
ENDIF.
ENDLOOP2
If l_flag = 1.
EXIT.
ENDIF.
ENDLOOP1
Thanks,
Vinod.
‎2010 Jan 20 2:01 PM
‎2010 Jan 20 1:44 PM
the short answer is YES; we have exit and we have continue.
insert the keyword, put your cursor on the word, press F1 and read...
‎2010 Jan 20 2:08 PM
David, do you mean there is other possible keyword that can help to exit more than one loop at a time?