The NDF_HPUT routine facilitates the inclusion of variable values in history records by allowing message tokens to be optionally embedded within the lines of text supplied to it. If this facility is required, then the TRANS argument should be set to .TRUE. to request message token translation, and the tokens used should be defined beforehand - for instance, by calling the appropriate MSG_ routines (see SUN/104 which includes a full description of message tokens). In the following example, the results of an earlier calculation are inserted into a history record in this way:
CALL MSG_SETI( 'NPIX', N )
CALL MSG_SETR( 'VALUE', RESULT )
CALL MSG_SETC( 'UNITS', CVAL )
TEXT( 1 ) = 'Result of summing ^NPIX pixels:'
TEXT( 2 ) = ' ^VALUE (^UNITS)'
TRANS = .TRUE.
CALL NDF_HPUT( HMODE, APPN, REPL, 2, TEXT, TRANS, WRAP, RJUST, INDF,
STATUS )