Important: The information in this document is obsolete and should not be used for new development.
SRGetIndexedItem
You can use theSRGetIndexedItem
function 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
TheSRGetIndexedItem
function returns, in theitem
parameter, a reference to the subitem at the index specified by theindex
parameter contained in the speech object specified by thecontainer
parameter. This function is useful for iterating through all subitems in a container object.The value passed in the
index
parameter must be greater than or equal to 0 and less than the number of subitems in the specified container object. (You can call theSRCountItems
function to determine the number of subitems contained in a speech object.) If the index you specify is not in this range,SRGetIndexedItem
returns the result codekSRParamOutOfRange
.SPECIAL CONSIDERATIONS
SRGetIndexedItem
increases the reference count of the specified speech object. You should call theSRReleaseObject
function to release the object reference returned bySRGetIndexedItem
when 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);