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 theGetIndexedCollectionItemInfofunction.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 theindexvariable 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 theGetCollectionItemInfofunction shown in Listing 5-6, thetagvariable contains the collection tag and theidvariable contains the collection ID of the item in thepointsAndQuotescollection with the collection index specified by theindexvariable.If you know the collection tag of an item and you know its tag list position, you can use the
GetTaggedCollectionItemInfofunction 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 thepointsAndQuotescollection with the tag'GXPT'. With thepointsAndQuotescollection 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
GetCollectionItemInfoandGetTaggedCollectionItemInfofunctions, see "Getting Information About a Collection Item" beginning on page 5-76.