Finding previously defined messages in Mathematica

Mathematica by default defines a lot of useful messages for signaling common errors, like functions being called with the wrong number of arguments or files not being found. In general, I prefer to use existing, defined messages wherever possible, because it makes it easier for them to be handled via mechanisms like Check , Quiet and On / Off . However, all my attempts at finding what messages are currently defined have failed; obvious approaches like

DownValues[MessageName] 

don't work at all.

Is there a trick I'm missing?

Thanks in advance.


That's a good question. In principle, you can display any messages associated with a symbol by using Messages[<symbol>] . However, according to the documentation, the system messages are not loaded until the message is actually used. But, $MessageGroups (new in 7) does provide a list of some of the messages available, but not nearly all.

EDIT: After some looking, I found the file $InstallationDirectory/SystemFiles/Kernel/TextResources/English/Messages.m that appears to contain all of the system wide messages.

链接地址: http://www.djcxy.com/p/35614.html

上一篇: 如何在Mathematica中查找调色板?

下一篇: 在Mathematica中查找以前定义的消息