Important: The information in this document is obsolete and should not be used for new development.
Determining the Tag and ID of an Item
Just as you can determine the collection index of an item given its collection tag and ID, you can also determine the collection tag and ID of an item given its collection index. Listing 5-6 shows how to determine an item's collection tag and collection ID using theGetIndexedCollectionItemInfo
function.Listing 5-6 Determining the tag and ID of an item given the item's index
long tag, id; . . . anErr = GetIndexedCollectionItemInfo(pointsAndQuotes, index, /* index of item */ &tag, /* returned tag */ &id, /* returned id */ dontWantSize, dontWantAttributes);You need to set the value of theindex
variable to contain the collection index of the desired item before making this call to the GetIndexedCollectionItemInfo function. (See the previous section, "Determining the Collection Index of an Item" on page 5-19, for in theGetCollectionItemInfo
function shown in Listing 5-6, thetag
variable contains the collection tag and theid
variable contains the collection ID of the item in thepointsAndQuotes
collection with the collection index specified by theindex
variable.If you know the collection tag of an item and you know its tag list position, you can use the
GetTaggedCollectionItemInfo
function to determine its collection ID. For example, you could also use the call
anErr = GetTaggedCollectionItemInfo(pointsAndQuotes, 'GXPT', 11, &id, dontWantIndex, dontWantSize, dontWantAttributes);to determine the collection ID of the eleventh item in thepointsAndQuotes
collection with the tag'GXPT'
. With thepointsAndQuotes
collection defined in "Adding Items to a Collection" beginning on page 5-17, the collection ID of this item turns out to be 15.For more information about identifying collection items, see "Methods of Identifying Collection Items" on page 5-11.
For more information about the
GetCollectionItemInfo
andGetTaggedCollectionItemInfo
functions, see "Getting Information About a Collection Item" beginning on page 5-76.