Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Package Development > Messages > Message >
Mathematica > Core Language > Tuning & Debugging > Messages > Message >

Message

Message
prints the message unless it has been switched off.
Message
prints a message, inserting the values of the as needed.
  • You can switch off a message using Off. You can switch on a message using On.
  • Between any two successive input lines, Mathematica prints a message with a particular name at most three times. On the last occurrence, it prints the message General.
  • Off[General::stop] makes Mathematica not stop repeating messages.
  • During the evaluation of a particular input line, names of messages associated with that input line are appended to the list $MessageList, wrapped with HoldForm. At the end of the evaluation of the n^(th) input line, the value of $MessageList is assigned to MessageList[n].
  • Message is printed as StringForm where mess is the value of the message mname. Entries of the form in the string mess are replaced by the corresponding .
  • Given a message specified as , Message first searches for messages for each of the languages in the list $Language. If it finds none of these, it then searches for the actual message . If it does not find this, it then performs the same search procedure for General::tag. If it still finds no message, it applies any value given for the global variable $NewMessage to symbol and .
  • If you specify a message as , then Message will search only for messages with the particular language lang.
Issue a message:
Define a function to issue a message and return unevaluated upon an error:
Define the message:
Issue a message:
 
Define a function to issue a message and return unevaluated upon an error:
In[1]:=
Click for copyable input
Define the message:
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF