General Messages
Lets take another look at Mag defined above. We could also define a message for the case where Mag gets more that one argument. However, we would be wise to note define a special message for when too many arguments are given, because Mathematica already has a set of generic messages that can be associated with many functions. All the built-in messages are defined in the file (messages.m). In the next cell the message used is , but no message named has been defined. When the kernel sees there is no message named , it looks for one named in (messages.m) and it finds one. Mathematica then usees the text for but when the message is displayed its labled . This allows commonly used messages to be shared by many functions. The messages are briefly explained in section 2.8.21 of the Mathematica Book
Once the rule above is defined, Mag[__] will post a message and return the
input when it is given more than one argument.
I tried to pick out the general messages that might have applications in
packages users write and they are each used in a generic example below. You
will find that related messages are arranged in grouped cells.
Number of arguments
Below we have general messages that report an incorrect number of
arguments.
Invalid arguments
Below we have general messages that report incorrect type of arguments.
Options
Below we have general messages that report problems with options
Matrices
Below we have general messages that report problems with matrices.
Iterators
Below we have general messages that report problems with iterators.
Directories, Files, I/O
Below we have general messages that report problems with directories, files,
or I/O.
Polynomials
Below we have general messages that report problems related to polynomials.
Graphics
Below we have general messages that report problems related to graphics.
Miscellaneous
Below we have general messages that report a variaty of other problems.
Created by Mathematica (May 16, 2004)