next up previous 211
Next: Intercepting messages
Up: MSG - Message Reporting System
Previous: Formatted tokens


Including escape characters in messages

Sometimes it is necessary to include the message token escape character, ``$^\wedge$'', literally in a message. When the message token escape character is immediately followed by a blank space, or is at the end of the MSG_OUT text, it is included literally. If this is not the case, then it can be included literally by duplicating it. So, for example:

      CALL MSG_SETC( 'TOKEN', 'message token' )
      CALL MSG_OUT( 'EXAM_UPARROW', 
     :             'Up-arrow, ^^, is the ^TOKEN escape character.', 
     :             STATUS )

would produce the message:

Up-arrow, ^, is the message token escape character.

Escape characters and token names will also be output literally if they appear within the value assigned to a message token; i.e. message token substitution is not recursive. This means that if the message system is to be used to output the value of a character variable, the contents of which are unknown and may therefore include escape characters, the value should first be assigned to a message token. Thus,

      CALL MSG_SETC( 'TEXT', VALUE )
      CALL MSG_OUT( 'EXAMPLE_OK', '^TEXT', STATUS )

will output the contents of VALUE literally, whereas

      CALL MSG_OUT( 'EXAMPLE_BAD', VALUE, STATUS )

might not produce the desired result. This consideration is particularly important when outputting text values such as file names within the ADAM environment, where a number of additional escape characters are defined.



next up previous 211
Next: Intercepting messages
Up: MSG - Message Reporting System
Previous: Formatted tokens

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