System.Classes.TList.Add

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

function Add(Item: Pointer): Integer;

C++

int __fastcall Add(void * Item);

Properties

Type Visibility Source Unit Parent
function public
System.Classes.pas
System.Classes.hpp
System.Classes TList

Description

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 (Object Pascal) or NULL (C++) pointers.

See Also

Code Examples