next up previous 211
Next: Conditional message reporting
Up: MSG - Message Reporting System
Previous: Overview


Reporting messages

The primary message reporting subroutine is MSG_OUT. It has a calling sequence of the form:

      CALL MSG_OUT( PARAM, TEXT, STATUS )

where the argument PARAM is a character string giving the name of the message, TEXT is a character string giving the message text, and STATUS is the integer subroutine status value. MSG_OUT sends the message string, TEXT, to the standard output stream which will normally be the user's terminal.

The subroutine MSG_OUT uses the Starlink convention of inherited status. This means that calls to MSG_OUT will not output the message unless the given value of STATUS is equal to SAI__OK. If an error is encountered within the subroutine, then STATUS is returned set to an error value. (The global constant SAI__OK is defined in the include file SAE_PAR. )

The maximum length for an output message is 300 characters. If it exceeds this length, then the message is truncated with an ellipsis, i.e. ``...'', but no error will result.

By default, messages are split so that output lines do not exceed 79 characters - the split is made on word boundaries if possible. The maximum output line size can be altered using tuning parameters.

It is recommended that, within the application, the message name, PARAM, should be a unique identifier for the message string, TEXT. However, the message name serves no useful purpose within a stand-alone application and is often given as a blank string. In ADAM applications the message name has a specific purpose.

Here is an example of using MSG_OUT:

      CALL MSG_OUT( 'EXAMPLE_MSGOUT', 'An example of MSG_OUT.', STATUS )
It is sometimes useful to intersperse blank lines amongst lines of textual output for clarity. This could be done using calls to MSG_OUT, e.g.
      CALL MSG_OUT( 'MSG_BLANK', ' ', STATUS )
For convenience, the subroutine MSG_BLANK has been provided for this purpose, e.g.
      CALL MSG_BLANK( STATUS )
The status argument in MSG_BLANK behaves in the same way as the status argument in MSG_OUT.



next up previous 211
Next: Conditional message reporting
Up: MSG - Message Reporting System
Previous: Overview

MERS (MSG and ERR) Message and Error Reporting Systems
Starlink User Note 104
P C T Rees
A J Chipperfield
22 October 2001
E-mail:ussc@star.rl.ac.uk

Copyright © 2001 Council for the Central Laboratory of the Research Councils