next up previous
Next: ARRAY COMPONENT STORAGE FORM
Up: EXTENSIONS
Previous: Deleting Extensions

Enumerating an NDF's Extensions  

The routine NDF_STATE may be used to determine whether an NDF contains any extensions by specifying a component name of `Extension'. Thus:

      LOGICAL STATE

      ...

      CALL NDF_STATE( INDF, 'Extension', STATE, STATUS )

will return a .TRUE. value via the STATE argument if one or more extensions are present in the NDF. The actual number of extensions present can be determined using the routine NDF_XNUMB. For instance:

      INTEGER NEXTN

      ...

      CALL NDF_XNUMB( INDF, NEXTN, STATUS )

will return the number of extensions via the NEXTN argument. The names of any extensions present can also be obtained, in this case using the routine NDF_XNAME. For instance:

      CHARACTER * ( NDF__SZXNM ) XNAME
      INTEGER N

      ...

      CALL NDF_XNAME( INDF, N, XNAME, STATUS )

will return the name of the N'th extension in upper-case via the XNAME argument. A blank name will be returned if no such extension exists. Note the use of the NDF__SZXNM symbolic constant (defined in the include file NDF_PAR) to declare the size of the character string which is to receive the extension name.

As an example, the following loop will list the names of all the extensions in an NDF:

      CALL NDF_XNUMB( INDF, NEXTN, STATUS )
      DO 1 I = 1, NEXTN
         CALL NDF_XNAME( INDF, I, XNAME, STATUS )
         CALL MSG_SETC( 'NAME', XNAME )
         CALL MSG_OUT( 'NAME', '^NAME', STATUS )
 1    CONTINUE



next up previous
Next: ARRAY COMPONENT STORAGE FORM
Up: EXTENSIONS
Previous: Deleting Extensions


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