[Overview][Types][Classes][Index] Reference for unit 'ObjectLists' (#lazutils)

TObjectArray.AddObject

Adds the specified item and its associated object to the storage in the class instance.

Declaration

Source position: objectlists.pas line 68

public function TObjectArray.AddObject(

  Item: TItem;

  Associated: TObj

):Integer;

Arguments

Item

  

Item stored in the association.

Associated

  

Object stored in the association.

Function result

Ordinal position where the association for the item and the object was stored.

Description

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

TObjectArray.List

  

Provides access to the list which implements the storage for the item/object associations in the class instance.

TObjectArray.Count

  

Number of item/object associations currently stored in the List.

TObjectArray.Capacity

  

Specifies the number of associations that can be stored in the List.

TObjectArray.Add

  

Adds the specified item to the storage for the class instance.

TObjectArray.InsertObject

  

Inserts an item/object association at the specified position in the List.

TObjectArray.Delete

  

Deletes an item/object association stored at the specified position in the List.

TObjectArray.Remove

  

Removes the association with the specified TItem class instance.

TObjectArray.Clear

  

Removes all item/object associations stored in the List.

TObjectArray.Items

  

Provides indexed access to the TItem class instances stored in the List.

TObjectArray.Objects

  

Provides indexed access to the TObj class instances stored in the List.


Version 4.0 Generated 2025-05-03 Home