symbol::tag
is a name for a message.
MessageName 
symbol::tag
is a name for a message.
Details
- You can specify messages by defining values for symbol::tag.
- symbol::tag is converted to MessageName[symbol,"tag"]. tag can contain any characters that can appear in symbol names. symbol::"tag" can also be used. »
- Assignments for s::tag are stored in the Messages value of the symbol s. »
- The f::usage message is typically defined for functions intended for general use, giving a description of how to use the function.
- ?f prints out the message f::usage. »
- When ?form finds more than one function, only the names of the functions are printed.
- You can switch on and off messages using On[s::tag] and Off[s::tag].
- MessageName[symbol,"tag","lang"] or symbol::tag::lang represents a message in a particular language. »
Examples
open all close allBasic Examples (2)
Scope (1)
Define separate messages for English and Spanish:
g::err::English = "There is a problem!";
g::err::Spanish = "¡Hay problema!";When $Language is English, the English text is used:
Block[{$Language = "English"}, Message[g::err]]When $Language is set to Spanish, the Spanish text is used:
Block[{$Language = "Spanish"}, Message[g::err]]For any other language, no text is found:
Block[{$Language = "French"}, Message[g::err]]Applications (2)
Process messages generated during an evaluation:
{Sin[1, 2.], BesselJ[3, 4.], Log[5, 6.], Exp[7, 8.]}mess = MessageList[-1]mest = Cases[mess, HoldForm[MessageName[f_, s_]] -> {f, s}]Define a function that will test another function and give the argx message if needed:
oneargtest[f_, args___] := Module[{nargs = Length[{args}]}, If[nargs ≠ 1, Message[MessageName[f, "argx"], nargs, 1];False, True]]oneargtest[g, 1, 2]Define g to use the test and return unevaluated when it fails:
g[args___] := Module[{x = First[{args}]}, (x - 1)(x + 1)] /; oneargtest[g, args]g[1, 2]g[1.5]Properties & Relations (3)
The forms symbol::tag and SymbolName[g,"tag"] are equivalent:
MessageName[g, "err"] === g::errThe messages assigned specifically to symbol are returned by Messages[symbol]:
f::usage = "f[] returns the answer";
f::err = "There was an error";
Messages[f]A message defined using the three-argument form is used when the third argument matches $Language:
MessageName[f, "err"] = "This is bad!";
MessageName[f, "err", "Spanish"] = "¡Esto es malo!";Block[{$Language = "Spanish"}, Message[f::err]]If there is no matching three-argument form defined, the text of the two-argument form is used:
Block[{$Language = "Hebrew"}, Message[f::err]]See Also
Message MessageList $MessageList
Menu Items: Make Template
Function Repository: MessageReplace SearchMessages
Tech Notes
-
▪
- Messages
Related Guides
Related Workflows
- Understand Error Messages ▪
- Find Out How a Message Was Generated
History
Introduced in 1988 (1.0) | Updated in 1999 (4.0) ▪ 2000 (4.1) ▪ 2002 (4.2)
Text
Wolfram Research (1988), MessageName, Wolfram Language function, https://reference.wolfram.com/language/ref/MessageName.html (updated 2002).
CMS
Wolfram Language. 1988. "MessageName." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2002. https://reference.wolfram.com/language/ref/MessageName.html.
APA
Wolfram Language. (1988). MessageName. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MessageName.html
BibTeX
@misc{reference.wolfram_2026_messagename, author="Wolfram Research", title="{MessageName}", year="2002", howpublished="\url{https://reference.wolfram.com/language/ref/MessageName.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_messagename, organization={Wolfram Research}, title={MessageName}, year={2002}, url={https://reference.wolfram.com/language/ref/MessageName.html}, note=[Accessed: 12-June-2026]}