Re: Full text of the current warning message(s)
- To: mathgroup at smc.vnet.net
- Subject: [mg33417] Re: Full text of the current warning message(s)
- From: lalu_bhatt at yahoo.com (Bhuvanesh)
- Date: Wed, 20 Mar 2002 01:53:56 -0500 (EST)
- References: <a76gbe$gn9$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Vladimir Bondarenko <vvb at mail.strace.net> 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?
I'm sure there must be a simpler way, but one way to do this would be
to write the message to a temporary file by appending the
corresponding OutputStream to $Messages, and then do Last[Import[file,
"Lines"]] to obtain the last message.
--
Bhuvanesh,
Wolfram Research