System.Generics.Collections.TDictionary.Clear
Delphi
procedure Clear;
C++
void __fastcall Clear(void);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | System.Generics.Collections.pas System.Generics.Collections.hpp |
System.Generics.Collections | TDictionary |
Description
Clear all data.
Clear removes all keys and values from the dictionary. The Count property is set to 0. The capacity is also set to 0. This operation requires O(n) time, where n is Count, the number of dictionary entries.
Note: Clear does not free the items as they are removed. If you need to free them, use the OnKeyNotify event and the OnValueNotify event, which occur for every entry removed and provides the removed items.
See Also
Code Examples