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  Message[Mag :: argx, _, _], but no message named Mag :: argx has been defined.  When the kernel sees there is no message named (Mag :: argx), it looks for one named (General :: argx) in  (messages.m) and it finds one.  Mathematica then usees the text for (General :: argx) but when the message is displayed its labled (Mag :: argx).  This allows commonly used messages to be shared by many functions.  The  messages (General :: tag) are briefly explained in section 2.8.21 of the Mathematica Book

Mag[arg1_, others__]/;         Message[Mag :: argx, Mag, Length[{arg1, others}]] := "Never get here."


Once the rule above is defined, Mag[__] will post a message and return the
input when it is given more than one argument.

Mag[3, 4, 5, 6]

Mag :: argx : Mag called with 4 arguments; 1 argument is expected.

Mag[3, 4, 5, 6]


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.

General :: argctu : ARG1 called with 1 argument.

General :: argct : ARG1 called with ARG2 arguments.

General :: argmu : ARG1 called with 1 argument; ARG2 or more arguments are  expected.

General :: argr : ARG1 called with 1 argument; ARG2 arguments are expected.

General :: argx : ARG1 called with ARG2 arguments; 1 argument is  expected.

General :: argbu : ARG1 called with 1 argument; between ARG2 and ARG3  arguments are expected.

General :: argf : ARG1 called with ARG2 arguments; ARG3 or fewer  arguments are expected.

General :: argm : ARG1 called with ARG2 arguments; ARG3 or more  arguments are expected.

General :: argrx : ARG1 called with ARG2 arguments; ARG3 arguments are  expected.

General :: argtu : ARG1 called with 1 argument; ARG2 or ARG3 arguments  are expected.

General :: argb : ARG1 called with ARG2 arguments; between ARG3 and \! \(ARG4\) arguments are expected.

General :: argt : ARG1 called with ARG2 arguments; ARG3 or ARG4  arguments are expected.

Invalid arguments


Below we have general messages that report incorrect type of arguments.

General :: fnsym : First argument in ARG1 is not a symbol or a string naming a  symbol.

General :: notnorm : Argument ARG1 must be a nonatomic expression.

General :: bool : True or False expected at position ARG2 in ARG1 .

General :: ilsm : List of machine-size integers expected at position ARG2 in  ARG1 .

General :: ilsmi : Single or non-empty list of machine-size integers expected at position  ARG2 in ARG1 .

General :: ilsmn : Single or non-empty list of non-negative machine-size integers  expected at position ARG2 of ARG1 .

General :: ilsmp : Single or non-empty list of positive machine-size integers expected at  position ARG2 of ARG1 .

General :: innf : Non-negative integer or Infinity expected at position ARG2 in \! \(ARG1\).

General :: int : Integer expected at position ARG2 in ARG1 .

General :: intm : Machine-size integer expected at position ARG2 in  ARG1 .

General :: intnm : Non-negative machine-size integer expected at position ARG2 in  ARG1 .

General :: intnz : Non-zero integer expected at position ARG2 in ARG1 .

General :: intpm : Positive machine-size integer expected at position ARG2 in  ARG1 .

General :: ipnf : Positive integer or Infinity expected at position ARG2 in  ARG1 .

General :: list : List expected at position ARG2 in ARG1 .

General :: normal : Nonatomic expression expected at position ARG1 in  ARG2 .

General :: seqs : Sequence specification (+n, -n, {+n}, {-n}, {m, n}, or {m, n, s})  expected at position ARG2 in ARG1 .

General :: seqso : Sequence specification (+n, -n, {+n}, {-n}, or {m, n}) expected at  position ARG2 in ARG1 .

General :: string : String expected at position ARG1 in ARG2 .

General :: strs : String or non-empty list of strings expected at position ARG1 in  ARG2 .

General :: strse : String or list of strings expected at position ARG1 in  ARG2 .

General :: sym : Argument ARG1 at position ARG2 is expected to be a  symbol.

General :: zval : Non-numerical value ARG1 found at position ARG2 in first  argument.

Options


Below we have general messages that report problems with options

General :: mult : Value of option Multiplicity -> ARG1 is not a positive integer.

General :: estep : Value of option ARG1 -> ARG2 is not a positive  integer.

General :: iopf : Value of option ARG1 -> ARG2 should be an integer or  Infinity.

General :: iopnf : Value of option ARG1 -> ARG2 should be a non-negative  integer or Infinity.

General :: iopnm : Value of option ARG1 -> ARG2 should be a non-negative  machine-size integer.

General :: ioppf : Value of option ARG1 -> ARG2 should be a positive integer  or Infinity.

General :: modgp : Value of option ARG1 -> ARG2 should be a Gaussian prime  number.

General :: modn : Value of option ARG1 -> ARG2 should be an integer.

General :: modp : Value of option ARG1 -> ARG2 should be a prime number or  zero.

General :: npt : Value for option ARG1 -> ARG2 is expected to be a string.

General :: opset : Option ARG1 is not set in ARG2 .

General :: opstl : Value of option ARG1 -> ARG2 should be a string or a list  of strings.

General :: optrs : Option specification ARG1 in ARG2 is not a rule for a  symbol.

General :: opttf : Value of option ARG1 -> ARG2 should be True or False.

General :: opttfa : Value of option ARG1 -> ARG2 should be True, False, or  Automatic.

General :: optx : Unknown option ARG1 in ARG2 .

General :: par : Inappropriate parameter: ARG1 -> ARG2 .

General :: nonopt : Options expected (instead of ARG1) beyond position ARG2 in  ARG3. An option must be a rule or a list of rules.

Matrices


Below we have general messages that report problems with matrices.

General :: inf : Input matrix contains an infinite entry.

General :: mindet : Input matrix contains an indeterminate entry.

General :: sing : Matrix ARG1 is singular.

General :: luc : Result for ARG1 of badly conditioned matrix ARG2 may  contain significant numerical errors.

General :: matrix : Argument ARG1 at position ARG2 is not a rectangular  matrix.

General :: matsq : Argument ARG1 at position ARG2 is not a square  matrix.

Iterators


Below we have general messages that report problems with iterators.

General :: iterb : Iterator `1` does not have appropriate bounds.

General :: itraw : Raw object ARG1 cannot be used as an iterator.

General :: ittag : Cannot use ARG1 as an iterator, since it contains no assignment  tag.

General :: itform : Argument ARG1 at position ARG2 does not have the correct  form for an iterator.

Directories, Files, I/O


Below we have general messages that report problems with directories, files,
or I/O.

General :: isdir : Cannot open directory for reading.

General :: filro : Attempt to modify a read-only file during ARG1 .

General :: fstr : File specification ARG1 is not a string of one or more  characters.

General :: ioarg : Argument in ARG1 is not valid for I/O operation.

General :: ioerr : I/O error occurred during ARG1 .

General :: longp : Pathname in ARG1 is too long.

General :: nfdir : Directory not found during ARG1 .

General :: nffil : File not found during ARG1 .

General :: noopen : Cannot open ARG1 .

General :: openr : ARG1 is open for input.

General :: openw : ARG1 is open for output.

General :: openx : ARG1 is not open.

General :: aofil : ARG1 already open as ARG2 .

Polynomials


Below we have general messages that report problems related to polynomials.

General :: eival : Unable to find all roots of the characteristic polynomial.

General :: bmod : Modulus ARG1 must be an integer or an irreducible univariate  polynomial.

General :: modint : Modulus ARG1 must be an integer.

General :: modm : Modulus ARG1 is too large for this implementation.

General :: npoly : ARG1 is not a polynomial with rational number coefficients.

General :: npolys : ARG1 is not a list of polynomials with rational number  coefficients.

General :: poly : ARG1 is not a polynomial.

General :: polyx : ARG1 is not a polynomial with exact coefficients.

General :: nmod : ARG1 is not valid modulo ARG2 .

General :: npv : ARG1 is not a polynomial in ARG2 with rational number  coefficients.

General :: nrpi : ARG1 is not a logical formula consisting of polynomial equations  and inequalities in ARG2 with real number coefficients.

General :: nrtpi : ARG1 is not a logical formula consisting of polynomial equations  and inequalities in ARG2 with rational number coefficients.

Graphics


Below we have general messages that report problems related to graphics.

General :: pcolor : The shading function has produced colors of different types.

General :: color : ARG1 is not a valid color or gray-level specification.

General :: lspec : ARG1 is not a valid color, thickness, or dashing specification.

General :: colfun : The ColorFunction ARG1 does not produce a valid color or  gray-level directive when applied to element ARG2 .

General :: colfun1 : The ColorFunction ARG1 produces a color incompatible with the  previous color when applied to element ARG2 .

General :: gprim : ARG2 was encountered where a ARG1 primitive or directive  was expected.

Miscellaneous


Below we have general messages that report a variaty of other problems.

General :: bktfn : \"ARG1\" should probably be \"ARG2\".ARG4

General :: cfail : Algorithm failed to converge.

General :: dbyz : Division by zero.

General :: fas : Warning: self-contradictory assumptions encountered.

General :: ovfl : Overflow occurred in computation.

General :: unpack1 : Unpacking array.

General :: fmtval : ARG1 is not a valid format type.

General :: globn : No matches for ARG1 .

General :: ifexp : The exponent ARG1 is not an integer.

General :: ifpa : The precision or accuracy ARG1 is not representable as a machine  number.

General :: indet : Indeterminate expression ARG1 encountered.

General :: ivar : ARG1 is not a valid variable.

General :: level : Level specification ARG1 is not of the form n, {n}, or {m,  n}.

General :: nalg : ARG1 is not an algebraic number.

General :: nlist3 : ARG1 is not a list of three numbers.

General :: notfound : Symbol ARG1 not found.

General :: notnorm : Argument ARG1 must be a nonatomic expression.

General :: notstr : The format type ARG1 is valid only for string input.

General :: primm : Tried ARG1 primes, algorithm failed.

General :: prims : Prime ARG1 is too small, algorithm failed.

General :: punpack1 : Unpacking array to level ARG1 .

General :: rep : ARG1 is not a valid replacement rule.

General :: stop : Further output of ARG1 will be suppressed during this  calculation.

General :: unpack : Unpacking array in call to ARG1 .

General :: unuser : Unknown user: ARG1 .

General :: dupv : Duplicate variable ARG1 found in ARG2 .

General :: globm : Too many matches for ARG1: ARG2 .

General :: par : Inappropriate parameter: ARG1 -> ARG2 .

General :: plln : Limiting value ARG1 in ARG2 is not a machine-size real  number.

General :: precw : The precision of the argument function (ARG1) is less than  WorkingPrecision (ARG2).

General :: punpack : Unpacking array to level ARG2 in call to ARG1 .

General :: trace : ARG1 --> ARG2 .

General :: mbrpos : Position ARG2 in ARG1 must be one of ARG3 .

General :: tag : Rule for ARG1 of ARG2 can only be attached to ARG3 .

General :: bktmch : \"ARG1\" must be followed by \"ARG2\", not \"ARG3\". ARG4

General :: heads : Heads ARG1 and ARG2 at positions ARG3 and ARG4  are expected to be the same.

General :: itflrw : Warning: In evaluating ARG1 to find the number of iterations to   ... on = ARG3 was encountered. An upper  estimate will be used for the number of iterations.

General :: newsym : Symbol ARG1 is new.


Created by Mathematica  (May 16, 2004)

Back to Ted’s Tricks index page