The following example is a simple application which sets a new title for an existing NDF. Note the use of `UPDATE' access, since an existing NDF is being modified rather than creating a new one.
SUBROUTINE SETTITLE( STATUS )
*+
* Name:
* SETTITLE
* Purpose:
* Set a new title for an NDF data structure.
* Description:
* This routine sets a new value for the title component of an
* existing NDF data structure. The NDF is accessed in update mode
* and any pre-existing title is over-written with a new value.
* Alternatively, if a "null" value (!) is given for the TITLE
* parameter, then the NDF's title will be erased.
* ADAM Parameters:
* NDF = NDF (Read and Write)
* The NDF data structure whose title is to be modified.
* TITLE = LITERAL (Read)
* The value to be assigned to the NDF's title component. [!]
*-
* Type Definitions:
IMPLICIT NONE ! No implicit typing
* Global Constants:
INCLUDE 'SAE_PAR' ! Standard SAE constants
* Status:
INTEGER STATUS ! Global status
* Local Variables:
INTEGER NDF ! NDF identifier
*.
* Check inherited global status.
IF ( STATUS .NE. SAI__OK ) RETURN
* Obtain an identifier for the NDF to be modified.
CALL NDF_ASSOC( 'NDF', 'UPDATE', NDF, STATUS )
* Reset any existing title.
CALL NDF_RESET( NDF, 'Title', STATUS )
* Obtain a new title.
CALL NDF_CINP( 'TITLE', NDF, 'Title', STATUS )
* Annul the NDF identifier.
CALL NDF_ANNUL( NDF, STATUS )
END
The following is an example ADAM interface file (settitle.ifl) for the application above.
interface SETTITLE
parameter NDF # NDF to be modified
position 1
prompt 'Data structure'
endparameter
parameter TITLE # New title value
position 2
type 'LITERAL'
prompt 'New NDF title'
endparameter
endinterface