Important: The information in this document is obsolete and should not be used for new development.
SRGetIndexedItem
You can use theSRGetIndexedItemfunction to get a subitem in a container object.
pascal OSErr SRGetIndexedItem ( SRSpeechObject container, SRSpeechObject *item, long index);
container- A speech object.
item- On exit, a reference to the subitem in the specified speech object that has the specified index.
index- An integer ranging from 0 to one less than the number of subitems in the specified speech object.
DESCRIPTION
TheSRGetIndexedItemfunction returns, in theitemparameter, a reference to the subitem at the index specified by theindexparameter contained in the speech object specified by thecontainerparameter. This function is useful for iterating through all subitems in a container object.The value passed in the
indexparameter must be greater than or equal to 0 and less than the number of subitems in the specified container object. (You can call theSRCountItemsfunction to determine the number of subitems contained in a speech object.) If the index you specify is not in this range,SRGetIndexedItemreturns the result codekSRParamOutOfRange.SPECIAL CONSIDERATIONS
SRGetIndexedItemincreases the reference count of the specified speech object. You should call theSRReleaseObjectfunction to release the object reference returned bySRGetIndexedItemwhen you're done using it. For example, you can get a reference to the third word in a phrase by executing this code:
myErr = SRGetIndexedItem(myPhrase, &myWord, 2);Then, when you are finished using the word, you should execute this code:
myErr = SRReleaseObject(myWord);