This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)
 Documentation / Mathematica / Built-in Functions / Programming / Flow Control  /
Break

  • Break[ ] exits the nearest enclosing Do, For or While.
  • 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.
  • See the Mathematica book: Section 2.5.9.
  • See also: Continue, Return, Goto, Abort.

    Further Examples

    In[1]:=

    The Break[] causes the loop to terminate as soon as t exceeds a value of 10.

    In[2]:=

    1

    2

    6

    24

    In[3]:=