next up previous 211
Next: Renewing annulled message tokens
Up: MSG - Message Reporting System
Previous: Including escape characters in messages


Intercepting messages

It may sometimes be convenient within an application to write the text of a message, complete with decoded message tokens, to a character variable instead of the standard output stream. The Message System provides subroutine MSG_LOAD to do this. MSG_LOAD has the calling sequence:

      CALL MSG_LOAD( PARAM, TEXT, OPSTR, OPLEN, STATUS )

Here, the arguments PARAM, TEXT and STATUS are identical to those for MSG_OUT. The behaviour of MSG_LOAD is also the same as MSG_OUT except that, instead of sending the expanded message text to the standard output stream, MSG_LOAD returns it in the character variable OPSTR (regardless the output filtering level). OPLEN returns the length of the message in OPSTR. If the message text is longer than the declared length of OPSTR, then the message is truncated with an ellipsis, i.e. ``...'', but no error results.

The symbolic constant MSG__SZMSG is provided for defining the length of character variables which are to hold such messages. This constant is defined in the include file MSG_PAR.



next up previous 211
Next: Renewing annulled message tokens
Up: MSG - Message Reporting System
Previous: Including escape characters in messages

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