The MESSAGE procedure issues error and informational messages using the same mechanism employed by built-in IDL routines. By default, the message is issued as an error, the message is output, and IDL takes the action specified by the ON_ERROR procedure. As a side-effect of issuing the error, the system variable !ERROR_STATE is set and the text of the error message is placed in !ERROR_STATE.MSG or in !ERROR_STATE.SYS_MSG for the operating system's component of the error message.

If the call to the MESSAGE procedure causes execution to halt, traceback information is displayed automatically.

Calling Sequence

MESSAGE, [ T ext ]



The text of the message to be issued. If Text is not supplied, MESSAGE returns quietly.



Set this keyword to return after issuing the error instead of taking the action specified by ON_ERROR. Use this option when it is desirable to report an error and then continue processing.


Set this keyword to issue informational text instead of an error. In this case, !ERR, !ERROR, and !ERR_STRING are not set. The !QUIET system variable controls the printing of informational messages.


Set this keyword to indicates that the error occurred while performing I/O. The action specified by the ON_IOERROR procedure is executed instead of ON_ERROR.


Set this keyword to suppress printing of the issuing routine's name at the beginning of the error message.


Usually, the message includes the message prefix string (as specified by the MSG_PREFIX field of the !ERROR_STATE system variable) at the beginning. Set this keyword to omit the prefix.


Set this keyword to prevent the message from printing to the screen and cause the other actions to proceed quietly. The error system variables are updated as usual.


Set this keyword to set the system variable back to the "success" state and clear any internal traceback information being saved for use by the LAST_ERROR keyword to the HELP procedure.


This keyword is obsolete and is included for compatibility with existing code only. Traceback information is provided by default.


As an example, assume the statement:

message, 'Unexpected value encountered.'

is executed in a procedure named CALC. If an error occurs, the following message would be printed:

% CALC: Unexpected value encountered.

and execution would halt.

See Also