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  /
CheckAbort

  • CheckAbort[ expr , failexpr ] evaluates expr, returning failexpr if an abort occurs.
  • CheckAbort absorbs any aborts it handles, and does not propagate them further.
  • CheckAbort works inside AbortProtect.
  • CheckAbort has attribute HoldAll.
  • See the Mathematica book: Section 2.5.13.
  • See also: Catch.

    Further Examples

    CheckAbort catches the Abort, and returns the value aborted.

    In[1]:=

    a

    Out[1]=

    The effect of the Abort is contained by CheckAbort, so the second Print is executed.

    In[2]:=

    a

    b