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


LAddColumn

You can use the LAddColumn function to add one or more columns to a list.

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

If the column number specified by colNum is not already in the list, then new last columns are added. The value returned by the LAddColumn function thus has significance only in this case.

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

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

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

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


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996