RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TObjectList.Add Method

Inserts an object at the end of the list.

Pascal
function Add(AObject: TObject): Integer;
C++
__fastcall int Add(TObject * AObject);

Call Add to insert an object at the end of the list. Add places the object after the last item, even if the array contains nil (Delphi) or NULL (C++) references, and returns the index of the inserted object. (The first object in the list has an index of 0.) 

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

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!