next up previous
Next: The History Update Mode
Up: THE HISTORY COMPONENT
Previous: Propagation of History Information

Explicitly Controlling History Text   

When writing an application, you have the option of accepting the default history recording provided by the NDF_ library, or you may want to add further information of which the NDF_ system is unaware (a record of the results of a calculation, for instance). Not only is it possible to add such information, either prefixing or appending it to the default history text, but it is also possible to replace the default history text entirely if required.

The routine which allows this is NDF_HPUT, which writes new textual information to a history record, thus:

      CHARACTER HMODE * ( NDF__SZHUM ), TEXT( 2 ) * ( NDF__SZHIS )
      LOGICAL REPL, TRANS, WRAP, RJUST

      ...

      HMODE = 'NORMAL'
      APPN = ' '
      REPL = .FALSE.
      TEXT( 1 ) = 'This is explicit history information (line 1)...'
      TEXT( 2 ) = '   ...and this is the second line.'
      TRANS = .FALSE.
      WRAP = .FALSE.
      RJUST = .FALSE.
      CALL NDF_HPUT( HMODE, APPN, REPL, 2, TEXT, TRANS, WRAP, RJUST, INDF,
                     STATUS )

In this example, NDF_HPUT is being used to append two lines of text, stored in the TEXT array, to the text of the current history record for an NDF - remember, a new history record is normally created for each application which executes. (The HMODE, APPN, TRANS, WRAP and RJUST arguments can be ignored for the moment; their use is described in subsequent sections.)

If this is the first history information to be written to this particular NDF by the current application, then there will not yet be a history record to contain it. In this case, NDF_HPUT will create a new record and initialise it, recording the date and time and other standard information. The text provided will then form the first two lines of the text associated with the history record. If a current record already exists, NDF_HPUT will instead simply append the text to whatever may have been written earlier.

Normally, default history information is not written by the NDF_ system until an NDF is released, so information written by NDF_HPUT in the manner above will be prefixed to this default information. If a different order is required, then the routine NDF_HDEF may be used to force the default history information to be written prematurely, thus:

      CALL NDF_HDEF( INDF, STATUS )

It will then not be written when the NDF is released. This makes it possible to interleave explicit and default history text in any order.

It is also possible to prevent default information from being written at all by setting the REPL argument of NDF_HPUT to .TRUE., indicating that the new text is to replace that provided by default. If the default information has not yet been written (normally the case), it will be completely suppressed by this action. A single such call to NDF_HPUT is sufficient and default history recording cannot then be re-established until the NDF has been released (or a new application started - see §[*]).



next up previous
Next: The History Update Mode
Up: THE HISTORY COMPONENT
Previous: Propagation of History Information


Starlink User Note 33
R.F. Warren-Smith
11th January 2000
E-mail:rfws@star.rl.ac.uk

Copyright © 2000 Council for the Central Laboratory of the Research Councils