This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Mathematica Sessions  /
MessageList

  • MessageList[ n ] is a global object assigned to be a list of the names of messages generated during the processing of the n input line.
  • Only messages that are actually output are included in the list MessageList[ n ].
  • The message names in the list are wrapped with HoldForm.
  • MessageList[ n ] includes messages generated both by built-in functions and by explicit invocations of Message.
  • See the Mathematica book: Section 2.8.21Section 2.13.1.
  • See also: $MessageList.

    Further Examples

    This returns $MessageList (the value of which is assigned to MessageList[n]), which gives a list of the messages produced.

    In[1]:=

    Sqrt::argx: Sqrt called with 3 arguments; 1 argument is expected.

    Exp::argx: Exp called with 2 arguments; 1 argument is expected.

    Out[1]=

    The message names are wrapped in HoldForm to stop them from evaluating.

    In[2]:=

    Out[2]//InputForm=