Carbon


TXNCountRunsInRange

Header: MacTextEditor.h Carbon status: Supported

Obtains a count of the style runs in a range of elements.

OSStatus TXNCountRunsInRange (
    TXNObject iTXNObject, 
    UInt32 iStartOffset, 
    UInt32 iEndOffset, 
    ItemCount *oRunCount
);
Parameter descriptions
iTXNObject

A variable of type TXNObject. Pass the text object for the current text area.

iStartOffset

A variable of type TXNOffset. Pass a value specifying the beginning of the range of elements in the document that you want to examine. Note that this offset is a generic counter of elements (such as characters, pictures, and movies), not an offset into memory.

iEndOffset

An variable of type TXNOffset. Pass a value specifying the end of the range of elements in the document that you want to examine. Note that this offset is a generic counter of elements (such as characters, pictures, sounds, and movies), not an offset into memory.

oRunCount

A pointer to a variable of type ItemCount. On return, the ItemCount value is the count of style runs in the specified range.

function result

A result code. .

DISCUSSION

Given a range in a document that is specified by a starting and ending offset, you can use the TXNCountRunsInRange function to obtain a count of the changes in text styles, graphics, movies, or sounds in that range. Once you have a run count, you can supply this information to TXNGetIndexedRunInfoFromRange in order to obtain information about the runs themselves.

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/17/2000)