Carbon


LGetCellDataLocation

Header: Lists.h Carbon status: Supported

Finds the memory location of cell data.

void LGetCellDataLocation (
    SInt16 *offset, 
    SInt16 *len, 
    Cell theCell, 
    ListHandle lHandle
);
Parameter descriptions
offset

On return, a pointer to the offset of the cell’s data, specified from the beginning of the data handle referenced by the cells field of the list record.

len

On return, a pointer to the length of the cell’s data in bytes.

theCell

The cell whose data’s location is sought.

lHandle

The list containing the cell specified by the parameter theCell.

DISCUSSION

Your application can use this function to read cell data. The cells field of the list record contains a handle to a relocatable block used to store all cell data. When this function returns, the offset parameter contains the offset of the specified cell’s data in this relocatable block, and the len parameter specifies the length in bytes of the cell’s data. In other words, the first byte of cell data is located at Ptr(ORD4(lHandle^^.cells^) + offset), and the last byte of cell data is located at Ptr(ORD4(lHandle^^.cells^) + offset + len). Your application should not modify the contents of the cells field directly. To change a cell’s data, use the LSetCell function or the LAddToCell function.

If the cell coordinates specified by the parameter theCell are invalid, then the function sets the offset and len parameters to –1.

This function is also available as the LFind function.

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)