Check
Check[expr,failexpr]
evaluates expr, and returns the result, unless messages were generated, in which case it evaluates and returns failexpr.
Check[expr,failexpr,{s1::t1,s2::t2,…}]
checks only for the specified messages.
Check[expr,failexpr,"name"]
checks only for messages in the named message group.
Details
- Check has attribute HoldAll.
- Check does not test for messages that have been switched off using Off, or by uses of Quiet that occur inside it.
- The operation of Check is not affected by being enclosed inside Quiet.
- In Check[expr,failexpr,"name"], possible named message groups are given by $MessageGroups.
- Explicit message names of the form s::t can be mixed with named message groups.
Examples
open allclose allScope (3)
Applications (1)
Properties & Relations (3)
Text
Wolfram Research (1988), Check, Wolfram Language function, https://reference.wolfram.com/language/ref/Check.html (updated 2008).
CMS
Wolfram Language. 1988. "Check." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2008. https://reference.wolfram.com/language/ref/Check.html.
APA
Wolfram Language. (1988). Check. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Check.html