Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'How to pass full error message to a function?' topicStudent Support Forum > General > Archives > "How to pass full error message to a function?"

Next Comment >Help | Reply To Topic
Author Comment/Response
Brad
08/17/12 5:11pm

Hi guys. This will be a question from Rookie-ville, so please bear with me.

I have a situation where NonlinearModelFit gets called repeatedly, and sometimes generates an error message due to the initial parameters I've given it. When this happens, I would like to generate a pop-up dialog window that shows me any error/warning messages generated, and allows me to enter different initial parameters and try the fit again. I've got almost everything figured out, but I'm missing something about how to pass and display the entire messages in the dialog window (instead of the notebook).

A simplified illustration might be this:

Quiet[ Check[ 1/0, errors = $MessageList; myDialog[errors]; ] ];

Somewhere in the 'myDialog' function (which defines my pop-up), I should be able to take the 'errors' parameter, and reconstitute the full message:

Power::infy: "Infinite expression 1/0 encountered. "

My best guess so far was to use something like (assuming a single message):

Message[ errors[[1]] //ReleaseHold ]

but that definitely does not work.

Any pointers would be much appreciated. Thanks a bunch, and have a great day.

URL: ,

Subject (listing for 'How to pass full error message to a function?')
Author Date Posted
How to pass full error message to a function? Brad 08/17/12 5:11pm
Re: How to pass full error message to a function? Michael 08/20/12 2:48pm
Re: Re: How to pass full error message to a fun... Brad 08/26/12 10:28pm
Next Comment >Help | Reply To Topic