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.
Attribute [, EntryNum]
The CDF ID of the file containing the
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
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
), but this is not required.
is a variable ID (as opposed to a variable name) and the variable is a zVariable, set this flag to indicate that the variable ID is a zVariable ID. The default is to assume that
is an rVariable ID. Note: the attribute must have a scope of VARIABLE_SCOPE.
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:
info = CDF_INQUIRE(cid)
<Expression> LONG = 4
Delete the first and third attributes:
CDF_ATTDELETE, cid, 'GLOBAL_ATTR1'
CDF_ATTDELETE, cid, 1
Select the new first attribute:
CDF_ATTINQ, cid, 0, name, scope, MaxEntry, MaxZentry
HELP, name, scope
NAME STRING = 'GLOBAL_ATTR2'
SCOPE STRING = 'GLOBAL_SCOPE'