Carbon


SRGetIndexedItem

Header: SpeechRecognition.h Carbon status: Supported

Gets a subitem in a container object.

OSErr SRGetIndexedItem (
    SRSpeechObject container, 
    SRSpeechObject *item, 
    SInt32 index
);
Parameter descriptions
container

A speech object.

item

On return, 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. (You can call the SRCountItems 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 code kSRParamOutOfRange.

function result

A result code.

DISCUSSION

This function is useful for iterating through all subitems in a container object.

SRGetIndexedItem increases the reference count of the specified speech object. You should call the SRReleaseObject function to release the object reference returned by SRGetIndexedItem when you are 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);

VERSION NOTES

In Speech Recognition Manager version 1.5, this function is useful only for operating on language objects (of type SRLanguageObject), although it is defined for all speech objects.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 7/10/2000)