API:System.Contnrs.TObjectList.RemoveItem
Delphi
function RemoveItem(AObject: TObject; ADirection: TList.TDirection): NativeInt; inline;
C++
HIDESBASE System::NativeInt __fastcall RemoveItem(System::TObject* AObject, System::Types::TDirection ADirection);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.Contnrs.pas System.Contnrs.hpp |
System.Contnrs | TObjectList |
Description
Removes an item from the list.
System.Contnrs.TObjectList.RemoveItem inherits from System.Classes.TList.RemoveItem. All content below this line refers to System.Classes.TList.RemoveItem.
Removes an item from the list. The returned value is the index of the removed item.
The RemoveItem method removes a specified item from the list. Because the search of the item is linear, it is an O(n) operation on a list with n entries. If the item is not found, -1 is returned.