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 / Getting Information About Cells


LNextCell

You can use the LNextCell function to find the next cell in a given row, in a given column, or in an entire list.

FUNCTION LNextCell (hNext: Boolean; vNext: Boolean; 
                    VAR theCell: Cell; lHandle: ListHandle)
                    : Boolean;
hNext
A Boolean value that indicates whether LNextCell should check columns other than the current column.
vNext
A Boolean value that indicates whether LNextCell should check rows other than the current row.
theCell
The coordinates of the current cell.
lHandle
The list in which to find the next cell.
DESCRIPTION
The behavior of the LNextCell function hinges on the values of the hNext and vNext parameters.

If hNext is TRUE and vNext is FALSE, then LNextCell tries to find a cell whose coordinates are greater than those of the cell specified in theCell parameter but that is in the same row as theCell. If successful, LNextCell sets the value of the theCell parameter to the first such cell and returns TRUE. If the cell initially specified by theCell is the last cell in its row, however, LNextCell returns FALSE.

If hNext is FALSE and vNext is TRUE, then LNextCell tries to find a cell whose coordinates are greater than those of the cell specified in theCell parameter but that is in the same column as theCell. If successful, LNextCell sets the value of the theCell parameter to the first such cell and returns TRUE. If, however, the cell initially specified by theCell is the last cell in its column, LNextCell returns FALSE.

If both hNext and vNext are TRUE, then LNextCell tries to find a cell whose coordinates are greater than those of the cell specified in the parameter theCell. If successful, LNextCell sets the value of the theCell parameter to the first such cell and returns TRUE. If, however, the cell initially specified by theCell is the last cell in the list, LNextCell returns FALSE.

Finally, if both hNext and vNext are FALSE, LNextCell simply returns FALSE.

SPECIAL CONSIDERATIONS
You should not call the LNextCell function from within an interrupt, such as in a completion routine or VBL task.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the LNextCell function are
Trap macroSelector
_Pack0$0048

SEE ALSO
Listing 4-7 on page 4-25 and Listing 4-8 on page 4-26 show how to find the first and last selected cell in a list.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996