613-518-1166 info@zimdatabases.com

ZIM Language Reference

BREAK (Loops)

< All Topics

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

CONTINUE

GOTO

WHILE

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents