confirms that no messages are generated during the evaluation of expr, otherwise quieting them and throwing an error to the nearest surrounding Enclose.
tests only for the specified message.
tests only for the specified list of messages.
tests only for messages in the named message group.
evaluates info and includes its value in the thrown error if expr is not confirmed.
uses the specified tag for any thrown errors.
- ConfirmQuiet[expr,…] returns expr if the evaluation of expr does not generate any specified messages.
- ConfirmQuiet is dynamically scoped when given a tag. Otherwise, it is lexically scoped. »
- The default value of info is Null.
- ConfirmQuiet does not test for messages that have been switched off using Off, or by uses of Quiet that occur inside it.
- The operation of ConfirmQuiet is not affected by being enclosed inside Quiet.
- In ConfirmQuiet[expr,"name"], possible named message groups are given by $MessageGroups.
- ConfirmQuiet stops evaluation when the first matching message is generated. »
- ConfirmQuiet[expr] is equivalent to ConfirmQuiet[expr,All].
- Failure objects generated by ConfirmQuiet include the following fields:
"Information" info from ConfirmQuiet[expr,mspec,info,…] "HeldExpression" Hold[expr] from ConfirmQuiet[expr,…] "HeldMessage" Hold[s::t] for the detected message s::t
- Values of these fields can be extracted using failure["prop"] or directly through Enclose[expr,"prop"].
Examplesopen allclose all
Basic Examples (1)
Create a function that calls ConfirmQuiet with a tag so that it can be caught dynamically:
If no tag is given, ConfirmQuiet is lexically scoped:
Properties & Relations (2)
Wolfram Research (2020), ConfirmQuiet, Wolfram Language function, https://reference.wolfram.com/language/ref/ConfirmQuiet.html.
Wolfram Language. 2020. "ConfirmQuiet." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ConfirmQuiet.html.
Wolfram Language. (2020). ConfirmQuiet. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ConfirmQuiet.html