API:System.Contnrs.TClassList.Add

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Add(AClass: TClass): Integer; inline;

C++

HIDESBASE int __fastcall Add(System::TClass AClass);

Properties

Type Visibility Source Unit Parent
function public
System.Contnrs.pas
System.Contnrs.hpp
System.Contnrs TClassList

Description

Inserts a new item at the end of the list.

System.Contnrs.TClassList.Add inherits from System.Classes.TList.Add. All content below this line refers to System.Classes.TList.Add.

Inserts a new item at the end of the list.

Call Add to insert a new object at the end of the Items array. Add returns the index of the new item, where the first item in the list has an index of 0.

Add increments Count and, if necessary, allocates memory by increasing the value of Capacity.

Note: Add always inserts the Item pointer at the end of the Items array, even if the Items array contains nil (Delphi) or NULL (C++) pointers.

See Also

Code Examples