Abort

Abort[]

generates an interrupt to abort a computation.

Details

  • You can call Abort anywhere within a computation. It has the same effect as an interactive interrupt in which you select the abort option.
  • You can use Abort as an "emergency stop" in a computation.
  • Once Abort has been called, Wolfram Language functions currently being evaluated return as quickly as possible.
  • In an interactive session, the final result from an aborted computation is $Aborted.
  • You can use CheckAbort to "catch" returns from an abort.

Examples

Basic Examples  (3)

Abort execution of a sequence of commands:

A function for doing fixed-point iteration that aborts if the value gets above a certain limit:

An unstable iteration:

A stable iteration to approximate GoldenRatio:

Abort the numerical solution of a differential equation if the solution would become complex:

Wolfram Research (1991), Abort, Wolfram Language function, https://reference.wolfram.com/language/ref/Abort.html.

Text

Wolfram Research (1991), Abort, Wolfram Language function, https://reference.wolfram.com/language/ref/Abort.html.

CMS

Wolfram Language. 1991. "Abort." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Abort.html.

APA

Wolfram Language. (1991). Abort. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Abort.html

BibTeX

@misc{reference.wolfram_2023_abort, author="Wolfram Research", title="{Abort}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/Abort.html}", note=[Accessed: 18-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_abort, organization={Wolfram Research}, title={Abort}, year={1991}, url={https://reference.wolfram.com/language/ref/Abort.html}, note=[Accessed: 18-March-2024 ]}