AbortProtect

AbortProtect[expr]

evaluates expr, saving any aborts until the evaluation is complete.

Details

Examples

open allclose all

Basic Examples  (2)

Protect part of a computation from early termination:

Use AbortProtect to ensure an assignment is made:

Although the computation returned $Aborted, x was assigned the value of the computation:

Without the AbortProtect, the assignment would not have been made:

Scope  (1)

Make sure that an iteration is finished in a time-constrained computation:

Without AbortProtect, typically imax is updated, but not x:

Properties & Relations  (5)

CheckAbort enables and detects aborts even if enclosed within AbortProtect:

While the computation inside the CheckAbort is terminated, AbortProtect runs to completion:

An enclosing AbortProtect is overridden by TimeConstrained:

While code inside the TimeConstrained is terminated, AbortProtect runs to completion:

A nested AbortProtect can block the action of TimeConstrained:

An enclosing AbortProtect is overridden by MemoryConstrained:

While code inside the MemoryConstrained is terminated, AbortProtect runs to completion:

A nested AbortProtect can block the action of MemoryConstrained:

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

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_abortprotect, organization={Wolfram Research}, title={AbortProtect}, year={1991}, url={https://reference.wolfram.com/language/ref/AbortProtect.html}, note=[Accessed: 22-December-2024 ]}