2. How to send an informational message#

  • The INFMAJ routine is used to inform the INFXXX « package » of the level of impressions requested by the user,

  • the INFNIV routine is used to retrieve the printing level requested by the user as well as the logical unit of the file “MESSAGE”.

  • The programmer of a command will therefore do:

  • put the keyword INFO in the order catalog: 2 possible values 1 and 2, default value:1

  • in routine OP000I

CALL GETVIS ('', 'INFO', 0, 1, 1, 1, NIV, IBID) CALL INFMAJ (NIV)
  • in a routine that wants to print INFO:

— CALL INFNIV (IFM, NIV)

— for a level 1 INFO (contractual):

IF (NIV .GE.1) WRITE (IFM,...)

— for a level 2 INFO:

IF (NIV .EQ.2) WRITE (IFM,...)

Notes:

One would think that level1 INFO*s can be written without being protected by*(IF (NIV .GE.1)…) because these prints are triggered by default. We will see in §3 « Protecting yourself from an excess of messages », why you need to protect them. *

To protect themselves from orders that do not have the keyword INFO in their catalog, the supervisor updates the COMMON before each order: CALL INFMAJ (1) .