Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Environment and Utilities /
Chapter 5 - Collection Manager / Collection Manager Reference
Functions / Removing Items From a Collection


You can use the RemoveIndexedCollectionItem function to remove an item from a collection given the item's index.

OSErr RemoveIndexedCollectionItem(Collection target, long index);
A reference to the collection object from which you want to remove the item.
The collection index of the item you want to remove.
The RemoveIndexedCollectionItem function removes the item specified by the index parameter from the collection referenced by the target 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.

collectionIndexRangeErr-5752Index is out of range.
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.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996