Carbon


LSearch

Header: Lists.h Carbon status: Supported

Finds a cell whose data matches data that you specify.

Boolean LSearch (
    const void *dataPtr, 
    SInt16 dataLen, 
    ListSearchUPP searchProc, 
    Cell *theCell, 
    ListHandle lHandle
);
Parameter descriptions
dataPtr

A pointer to the data being searched for.

dataLen

The length in bytes of the data being searched for.

searchProc

A pointer to a function to be used to compare the data being searched for with cell data. If NULL, the Text Utilities Package function IUMagIDString is used.

If either the function pointed to by searchProc or IUMagIDString returns 0, LSearch has found a match; otherwise, it checks the next cell in the list.

theCell

A pointer to the first cell to be searched. If the function finds a match, this parameter is, on return, a pointer to the coordinates of the first cell whose data matches the data being searched for.

lHandle

The list to be searched.

function result

If the function finds a match, TRUE. Otherwise, FALSE.

SPECIAL CONSIDERATIONS

This function is contained in a resource of resource type 'PACK'. Calling it could result in the loading of the package resource and the allocation of memory. Thus, your application should not call this function from within an interrupt, such as in a completion function or VBL task.

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 6/30/2000)