System.Classes.TList.Items

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Items[Index: Integer]: Pointer read Get write Put; default;

C++

__property void * Items[int Index] = {read=Get, write=Put/*, default*/};

Properties

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

Description

Lists the object references.

Use Items to obtain a pointer to a specific object in the array. The Index parameter indicates the index of the object, where 0 is the index of the first object, 1 is the index of the second object, and so on. Set Items to change the reference at a specific location.

Use Items with the Count property to iterate through all of the objects in the list.

Not all of the entries in the Items array need to contain references to objects. Some of the entries may be nil (Delphi) or NULL (C++) pointers. To remove the nil (Delphi) or NULL (C++) pointers and reduce the size of the Items array to the number of objects, call the Pack method.

Note: Items is the default property for TList. This means you can omit the property name. Thus, instead of MyList.Items[i], you can write MyList[i].

See Also

Code Examples