BREAK (Loops)
Documentation | Blog | Demos | Support
BREAK (Loops)
0 out of 5 stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |
Exits from a WHILE loop.
Syntax
BREAK
Comments
Upon encountering a BREAK command, the software continues execution at the first command following the ENDWHILE of the “innermost WHILE loop” containing the BREAK.
Any IF or CASE statements that are still open when a BREAK command is executed are automatically closed.
Example
Consider the following code fragment:
while var1 > 20
.. some commands …
if var2 = 1
break
else
… more commands …
endif
… still more commands …
endwhile
… commands after the WHILE loop …
When var2 is set to 1, the only commands executed in the above sequence are “some commands” and “commands after the WHILE loop”. Commands between the BREAK and ENDWHILE commands are ignored, and the “open” IF statement is automatically closed.
See Also
0 out of 5 stars
5 Stars | 0% | |
4 Stars | 0% | |
3 Stars | 0% | |
2 Stars | 0% | |
1 Stars | 0% |