9 COPYING AND DELETING OBJECTS

HDS objects may be individually copied and deleted. The routines DAT_COPY and DAT_ERASE will recursively copy and erase all levels of the hierarchy below that specified in the subroutine call:

        ...
        CHARACTER * ( DAT__SZLOC ) OLOC
  
  *  Copy the AXIS structure to component AXISCOPY of the structure located
  *  by OLOC (which must have been previously defined).
        CALL DAT_FIND( NLOC, ’AXIS’, ALOC, STATUS )
        CALL DAT_COPY( ALOC, OLOC, ’AXISCOPY’, STATUS )
        CALL DAT_ANNUL( ALOC, STATUS )
  
  * Erase the original AXIS structure.
        CALL DAT_ERASE( NLOC, ’AXIS’, STATUS )

Note that we annulled the locator to the AXIS object before attempting to delete it. This whole operation can also be done using DAT_MOVE:

  CALL DAT_MOVE( ALOC, OLOC, ’AXISCOPY’, STATUS )