Re: Full text of the current warning message(s)
- To: mathgroup at smc.vnet.net
- Subject: [mg33396] Re: Full text of the current warning message(s)
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 20 Mar 2002 01:52:58 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <a76gbe$gn9$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
args = {};
msgstring = Block[{lst, $MessagePrePrint = (AppendTo[args, #]; Short[#])
&},
NSum[1, {n, 1, foo}];
lst = $MessageList;
ToString[
StringForm @@ ({Evaluate[lst[[1]]], Sequence @@ args} /.
HoldForm[a_] :> a)]
]
msgstring will have the value of the full message and the variable.
Regards
Jens
Vladimir Bondarenko wrote:
>
> $MessageList is a global variable that gives a *list* of the names of messages
> generated by Mathematica during the evaluation of the current input line.
>
> How can I get the WHOLE text of the warning message(s)? (not only a template
> like "Expression `1` contains`2`" which are stored in Message.m) ?
>
> For example, NSum[1, {n, 1, foo}] generates the following warning message
>
> NSum::"nslim": "Limit of summation foo is not a number."
>
> What is the simplest way to store this string into a variable?
>
> Vladimir Bondarenko