Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.

Throw

Usage

Throw[value] stops evaluation and returns value as the value of the nearest enclosing Catch.
Throw[value, tag] is caught only by Catch[expr, form] where form is a pattern that matches tag.


Notes

• You can use Throw and Catch to exit functions such as Nest, Fold, FixedPoint and Scan.
tag can be any expression.
tag in Throw[value, tag] is re-evaluated every time it is compared to form in Catch[expr, form].
• An error is generated and an unevaluated Throw is returned if there is no appropriate enclosing Catch to catch the Throw.
• See Section 2.6.9.
• See also: Return, Goto, Interrupt, Abort, Sow.
• New in Version 1; modified in 3.


Any questions about topics on this page? Click here to get an individual response.Buy NowFree TrialMore Information



 © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: