TObjectArray.AddObject function
Adds the specified item and its associated object to the storage in the class instance.
Declaration
function AddObject(Item: TItem; Associated: TObj): IntegerDescription
AddObject is an
Integer function which adds the
specified item and its associated object to the storage in the class
instance. AddObject calls the
Grow method to increase storage in
the class instance when
Count reaches the value in
Capacity.
AddObject uses the List property to store the values in
Item and Associated to the corresponding properties at
the position in Count. The value in Count is incremented prior to
exiting from the method.
Use Add to store an Item with an unassigned associated object.
Use methods like Delete, Remove, and Clear
to remove one or all associations stored in List.
Use the indexed Items and Objects properties to access
values stored in an association at a specific position.
See also
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
