$MessageList

$MessageList
is a global variable that gives a list of the names of messages generated during the evaluation of the current input line.

DetailsDetails

  • Whenever a message is output, its name, wrapped with HoldForm, is appended to $MessageList.
  • With the standard Mathematica main loop, $MessageList is reset to when the processing of a particular input line is complete.
  • You can reset $MessageList during a computation.

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Get a list of messages produced in a computation:

In[1]:=
Click for copyable input
Out[1]=

Use messages for processing:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Printing can be suppressed by using $MessageList inside of Quiet:

In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
Out[4]=
New in 2
New to Mathematica? Find your learning path »
Have a question? Ask support »