System.Generics.Collections.TList.Clear

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure Clear; inline;

C++

void __fastcall Clear();

Properties

Type Visibility Source Unit Parent
procedure
function
public
System.Generics.Collections.pas
System.Generics.Collections.hpp
System.Generics.Collections TList

Description

Removes all list entries.

Clear removes all entries from a list. This is an O(1) operation. Both Capacity and Count are set to 0.

Note: Clear does not free the items as they are removed. If you need to free them, use the OnNotify event, which occurs for every item removed and provides the removed item.

See Also

Code Examples