CALL MSG_OUTIF( MSG__NORM, ' ', 'A conditional message', STATUS )Here, the first argument is the ``priority'' associated with the message and can be any one of three levels which are represented by symbolic constants defined in the include file MSG_PAR:
Whether or not the message will be output depends upon the ``conditional message output filter'' which may be set using the subroutine MSG_IFSET. e.g.
- MSG__QUIET
- - quiet mode, high priority;
- MSG__NORM
- - normal mode, normal priority (default);
- MSG__VERB
- - verbose mode, low priority.
CALL MSG_IFSET( MSG__QUIET, STATUS )The first argument of MSG_IFSET is the required conditional output filter level - it may take the same values as the message priority; by default it is set to MSG__NORM. The current conditional output filtering level may be inquired using subroutine MSG_IFLEV.
See also MSG_TUNE which allows the filter level to be set by an environment variable, and MSG_IFGET which allows ADAM programs to obtain the filter level from an ADAM parameter.
The action of MSG_OUTIF resulting from each of the defined priority values is as follows:
In this scheme, messages given the priority MSG__QUIET could never be turned off and would therefore be the most most important messages being output by an application.
- MSG__QUIET
- - always output given the message, regardless of output filter setting;
- MSG__NORM
- - output the given message if the current output filter is set to either MSG__NORM or MSG__VERB;
- MSG__VERB
- - output the given message only if the current output filter is set to MSG__VERB.
Here is an example of how conditional message output might be used in an application using interactive graphics with differing levels of informational messages to match how familiar the user is with the application:
* Use the cursor to enter the approximate positions of stars on the * displayed image to be fitted. CALL MSG_OUT( ' ', 'Use the cursor to enter star positions', : STATUS ) * Explain the positioning of the cursor. CALL MSG_OUTIF( MSG__NORM, ' ', : 'The graphics cursor should be positioned ' // : 'close to the centre of each star image', STATUS ) * Explain the cursor keys to new user. CALL MSG_OUTIF( MSG__VERB, ' ', 'Cursor keys: 1 add entry', STATUS ) CALL MSG_OUTIF( MSG__VERB, ' ', ' 2 reject last entry', : STATUS ) CALL MSG_OUTIF( MSG__VERB, ' ', ' 3 entry complete', : STATUS )
MERS (MSG and ERR) Message and Error Reporting Systems