Important: The information in this document is obsolete and should not be used for new development.
RemoveIndexedCollectionItem
You can use theRemoveIndexedCollectionItem
function to remove an item from a collection given the item's index.
OSErr RemoveIndexedCollectionItem(Collection target, long index);
target
- A reference to the collection object from which you want to remove the item.
index
- The collection index of the item you want to remove.
DESCRIPTION
TheRemoveIndexedCollectionItem
function removes the item specified by theindex
parameter from the collection referenced by thetarget
parameter. This function removes the specified item even if its lock attribute is set.If the target collection does not contain an item whose collection index matches the values in the
index
parameter, this function returns a collectionIndexRangeErr result code.RESULT CODES
collectionIndexRangeErr -5752 Index is out of range. SEE ALSO
For information about collection items, see "Collection Items" beginning on page 5-8.For examples using this function, see "Removing Items From a Collection" beginning on page 5-30.
To remove a collection item using the item's tag and ID (rather than the item's index), use the
RemoveCollectionItem
function, described in the previous section.To replace an item in a collection, use the functions described in "Adding and Replacing Items in a Collection" beginning on page 5-62.