next up previous
Next: Creating NDFs via Placeholders
Up: CONNECTING WITH THE DATA SYSTEM
Previous: Obtaining an HDS Locator for an NDF

NDF Placeholders   

Routines are also provided for the creation of NDFs at specified locations within the data system, rather than indirectly via parameters. These routines depend on the concept of a placeholder for their operation.

In many ways, a placeholder is similar to an NDF identifier; i.e. it is an integer value which the NDF_ system issues to identify an entity about which it holds information. In this case, however, the entity is not a data structure, but a position within the data system at which an NDF will be created at some later time.

An NDF placeholder may be obtained by calling the routine NDF_PLACE and specifying a name for the new NDF using an HDS locator and an absolute or relative name in the same way as when accessing an existing NDF (§[*]). Thus, if LOC is a locator associated with an existing HDS structure, then:

      CALL NDF_PLACE( LOC, 'NEW_NDF', PLACE, STATUS )

would return an integer value PLACE, which is a placeholder for a new NDF called 'NEW_NDF' contained within that structure. Similarly, the absolute name of a new NDF could be specified as follows:

      INCLUDE 'DAT_PAR'

      ...

      CALL NDF_PLACE( DAT__ROOT, 'file.STRUCT(2,2).NEW_NDF', PLACE, STATUS )

All the HDS structures residing at levels above the actual NDF object to be created must already exist, otherwise NDF_PLACE will fail.

Sometimes, it is more convenient if an object is already in existence at the location in the data system for which a placeholder is to be issued. For instance, this allows placeholders to refer to the individual elements of an array of structures which has previously been created, so that arrays of NDFs may be built. Any pre-existing object for which an NDF placeholder is to be issued must be a scalar structure and must have an HDS type of `NDF'. It must also be empty (i.e. it must have no components). NDF_PLACE is then called in the usual way. In the following example, for instance, a 1-dimensional array of structures is created with 5 elements, and a placeholder is then obtained for the second element:

      INTEGER DIM( 1 )

      ...

      DIM( 1 ) = 5
      CALL DAT_NEW( LOC, 'NDF_ARRAY', 'NDF', 1, DIM, STATUS )
      CALL NDF_PLACE( LOC, 'NDF_ARRAY(2)', PLACE, STATUS )

As with NDF_FIND, a blank name string may be supplied to NDF_PLACE to indicate that the data system location to be used is identified directly by the locator; this mode of use is only applicable when an object already exists at that location.



next up previous
Next: Creating NDFs via Placeholders
Up: CONNECTING WITH THE DATA SYSTEM
Previous: Obtaining an HDS Locator for an NDF


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