Mathematica 9 is now available
 Documentation / Mathematica / The Mathematica Book / Practical Introduction / Using the Mathematica System  /

1.3.11 Warnings and Messages

Mathematica usually goes about its work silently, giving output only when it has finished doing the calculations you asked for.
However, if it looks as if Mathematica is doing something you definitely did not intend, Mathematica will usually print a message to warn you.

  • The square root function should have only one argument. Mathematica prints a message to warn you that you have given two arguments here.
  • In[1]:= Sqrt[4, 5]

    Sqrt::argx: Sqrt called with 2 arguments; 1 argument is expected.

    Out[1]=

  • Each message has a name. You can switch off messages using Off.
  • In[2]:= Off[Sqrt::argx]

  • The message Sqrt::argx has now been switched off, and will no longer appear.
  • In[3]:= Sqrt[4, 5]

    Out[3]=

  • This switches Sqrt::argx back on again.
  • In[4]:= On[Sqrt::argx]


    Functions for controlling message output.



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.