switches on a message, so that it can be printed.

switches on a named group of messages.

switches on tracing for the symbol s.

switches on several messages or message groups.


  • Some messages for built-in functions are off by default, and must explicitly be switched on using On.
  • In On["name"], possible named message groups include:
  • "Compiler"warnings associated with compiled code
    "Graphics"warnings associated with graphics generation
    "Packing"notifications associated with packed arrays
    "Spelling"spell-checking messages for symbol names
    "Symbolics"warnings associated with symbolic computation
  • $MessageGroups gives a complete list of message groups recognized by On.
  • On[General::name] switches on all messages derived from General::name.
  • When tracing is switched on, each evaluation of a symbol, on its own or as a function, is printed, together with the result.
  • Note that the tracing information is printed when a function returns. As a result, traces of recursive functions appear in the opposite order from their calls.
  • On[Assert] switches on messages associated with assertions specified by Assert.
  • On[s] is equivalent to On[s::trace].
  • On[] is equivalent to On[s::trace] for all symbols.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Turn on a message that is issued whenever a new symbol is created:

Click for copyable input

Now when a new symbol is created the message is issued:

Click for copyable input

This turns the message back off:

Click for copyable input
Introduced in 1988
| Updated in 2010
Translate this page: