The CDF_ATTDELETE procedure deletes an attribute from the specified CDF file. Note that the attribute's entries are also deleted, and that the attributes which numerically follow the deleted attribute within the CDF file are automatically renumbered.
The CDF ID of the file containing the Attribute to be deleted, returned from a previoius call to CDF_OPEN or CDF_CREATE.
A string containing the name or zero-based attribute number of the attribute to be deleted.
The entry number to delete. If EntryNum is not specified, the entire attribute is deleted. If the attribute is variable in scope, this is either the name or number of the variable the attribute is to be associated with. If the attribute is global in scope, this is the actual gEntry. It is the user's responsibility to keep track of valid gEntry numbers. Normally gEntry numbers will begin with 0 or 1 and will increase up to MAXGENTRY (as reported in the GET_ATTR_INFO structure returned by CDF_CONTROL ), but this is not required.
cid = CDF_CREATE('DEMOattdelete')
attr1_id = CDF_ATTCREATE(cid, 'GLOBAL_ATTR1', /GLOBAL_SCOPE)
attr2_id = CDF_ATTCREATE(cid, 'GLOBAL_ATTR2', /GLOBAL_SCOPE)
attr3_id = CDF_ATTCREATE(cid, 'VAR_ATTR1', /VARIABLE_SCOPE)
attr4_id = CDF_ATTCREATE(cid, 'VAR_ATTR2', /VARIABLE_SCOPE)
Check the number of attributes:
Delete the first and third attributes:
CDF_ATTDELETE, cid, 'GLOBAL_ATTR1'
CDF_ATTDELETE, cid, 1 ; The attribute numbers are zero-based and automatically renumbered
Select the new first attribute:
CDF_ATTCREATE , CDF_ATTGET , CDF_ATTEXISTS , CDF_ATTINQ , CDF_ATTPUT , CDF_ATTRENAME