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 / Adding and Deleting Columns and Rows To and From a List


LAddRow

You can use the LAddRow function to add one or more rows to a list.

FUNCTION LAddRow (count: Integer; rowNum: Integer; 
                  lHandle: ListHandle): Integer;
count
The number of rows to add.
rowNum
The row number of the first row to add.
lHandle
The list to add the rows to.
DESCRIPTION
The LAddRow function inserts into the given list the number of rows specified by the count parameter, starting at the row specified by the rowNum parameter. The LAddRow function returns as its function result the row number of the first row added, which is equal to the value specified by the rowNum parameter if that value is a valid row number.

If the row number specified by rowNum is not already in the list, then new last rows are added. The value returned by the LAddRow function thus has significance only in this case.

WARNING
If there is insufficient memory in the heap to add the new rows, the LAddRow function may fail to add the new rows although it returns a positive function result. Be sure there is enough memory in the heap to allocate the new rows before calling LAddRow.
Rows whose row numbers are initially greater than rowNum have their row numbers increased by count.

If the automatic drawing mode is enabled and the rows added by LAddRow are visible, then the list (including its scroll bars) is updated. New cells created by a call to LAddRow are initially empty.

You may add rows to a list that does not yet have columns. The dataBounds field of the list record reflects that the list has rows, but you can only access cells when both rows and columns have been added.

SPECIAL CONSIDERATIONS
You should not call the LAddRow 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 LAddRow function are
Trap macroSelector
_Pack0$0008

SEE ALSO
For an example that adds rows to a list, see Listing 4-4 on page 4-22.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996