The routine NDF_CPUT may be used to assign new values to character components. For instance:
CALL NDF_CPUT( 'Surface Brightness', INDF, 'Lab', STATUS )
will assign the value `Surface Brightness' to the label component, overwriting any previous value which this component had. Note that the entire character string (including trailing blanks if present) will be assigned, and the length of the NDF's character component will be adjusted to match the new value. After a successful call to NDF_CPUT, the character component's state becomes defined.
It is quite common for an application to obtain a new value for a character component via a parameter and then to store this value in an NDF. The routine NDF_CINP is therefore provided to do this directly. For instance, the following will obtain new values for all three character components via suitable parameters and write the values to an NDF:
CALL NDF_CINP( 'LABEL', INDF, 'Label', STATUS )
CALL NDF_CINP( 'TITLE', INDF, 'Title', STATUS )
CALL NDF_CINP( 'UNITS', INDF, 'Units', STATUS )
The first argument to NDF_CINP specifies the parameter to be used, while the third argument is the name of the NDF character component whose value is to be replaced. If a null parameter value is specified (by the user entering `!' in response to a prompt, for instance), then NDF_CINP will return without action, i.e. without setting a new value for the character component. A suitable default value for the component should therefore be established before NDF_CINP is called.
An example of an ADAM interface file parameter entry
suitable for use with
NDF_CINP can be found in §.