- Break takes effect as soon as it is evaluated, even if it appears inside other functions.
- After a Break the value Null is returned from the enclosing control structure.
- The function of Break can also be achieved using Throw and Catch.
Examplesopen allclose all
Basic Examples (1)
Break out of the Do when i is larger than 2:
Break out of a Do loop:
Break out of a For loop:
Break out of a While loop:
Test the condition of a loop during or at the end of the loop:
Properties & Relations (2)
Introduced in 1988
Updated in 1996