RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TList.Insert Method

Adds an object to the Items array at the position specified by Index.

Pascal
procedure Insert(Index: Integer; Item: Pointer);
C++
__fastcall Insert(int Index, void * Item);

Call Insert to add Item to the middle of the Items array. The Index parameter is a zero-based index, so the first position in the array has an index of 0. Insert adds the item at the indicated position, shifting the item that previously occupied that position, and all subsequent items, up. Insert increments Count and, if necessary, allocates memory by increasing the value of Capacity

To replace a nil (Delphi) or NULL (C++) pointer in the array with a new item, without growing the Items array, set the Items property. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!