MESSAGE Procedure

Issues error and informational messages using the same mechanism employed by PV‑WAVE system routines.

Usage

    MESSAGE, text

Input Parameters

text—A text string containing the message.

Keywords

Continue—If present and nonzero, causes MESSAGE to return after issuing the error instead of taking the action specified by the ON_ERROR procedure. This keyword is useful when it is desirable to report an error and then continue processing.

Informational—If present and nonzero, specifies that the message is simply informational text, rather than an error, and that processing is to continue. In this case, !Err, !Error, and !Err_String are not set. The !Quiet system variable controls the printing of informational messages.

Ioerror—Indicates that the error occurred while performing I/O. In this case, the action specified by the ON_IOERROR procedure is executed instead of that specified by ON_ERROR.

Noname—Usually, the message includes the name of the issuing routine at the beginning. If Noname is present and nonzero, this name is omitted.

Noprefix—Usually, the message includes the message prefix string at the beginning (as specified by the !Msg_Prefix system variable). If Noprefix is present and nonzero, this prefix is omitted.

Noprint—If present and nonzero, causes actions to proceed quietly, without the message being printed to the screen. The error system variables are updated as usual.

Traceback—If present and nonzero, provides a traceback message giving the location at which MESSAGE was called. This traceback message follows the output error message.

Discussion

By default, MESSAGE halts execution of your routine; messages are issued as an error and PV‑WAVE takes the action specified by the ON_ERROR procedure. However, if you specify either the Continue or the Informational, processing of your routine continues uninterrupted.

As a side-effect of issuing the error, the system variables !Err and !Error are set and the text of the error message is placed in the system variable !Err_String.

Example 1

Assume the statement:

MESSAGE, 'Unexpected value encountered.'

is executed in a procedure named CALC. This would cause CALC to halt after the following message was issued:

% CALC: Unexpected value encountered.

Example 2

Assume the statement:

MESSAGE, 'Value is greater than 1000; ' + $
   'you will lose some accuracy.', /Noname, $
   /Noprefix, /Informational

is executed in a procedure named VERIFY. This would cause the following message to be issued:

Value is greater than 1000; you will lose some accuracy.

and execution would continue to the next line of VERIFY.

See Also

!Err, !Err_String, !Msg_Prefix, HAK, ON_ERROR, ON_IOERROR, WAIT

For more information, see System Variables.