Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: More Macintosh Toolbox /
Chapter 4 - List Manager / List Manager Reference
List Manager Routines / Accessing and Manipulating Cell Data


LGetCellDataLocation

You can find the memory location of cell data by using the LGetCellDataLocation procedure. The LGetCellDataLocation procedure is also available as the
LFind procedure.

PROCEDURE LGetCellDataLocation (VAR offset, len: Integer; 
                                theCell: Cell;
                                lHandle: ListHandle);
offset
The LGetCellDataLocation procedure returns in this parameter 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
The LGetCellDataLocation procedure returns in this parameter 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.
DESCRIPTION
Your application can use the LGetCellDataLocation procedure 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 LGetCellDataLocation 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).

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

WARNING
Your application should not modify the contents of the cells field directly. To change a cell's data, use the LSetCell procedure or the LAddToCell procedure.
SPECIAL CONSIDERATIONS
You should not call the LGetCellDataLocation procedure from within an interrupt, such as in a completion routine or VBL task.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the LGetCellDataLocation procedure are
Trap macroSelector
_Pack0$0034

SEE ALSO
For an example that uses the LGetCellDataLocation procedure to get the data of a cell, see Listing 4-13 on page 4-32.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996