RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TNamedVariantsList.GetCapacity Method

Returns the value of the Capacity property.

Pascal
function GetCapacity: Integer; override;
C++
virtual __fastcall int GetCapacity();

GetCapacity is the protected read implementation of the Capacity property. 

In TAbstractNamedVariants, GetCapacity always returns the value of the Count property, because TAbstractNamedVariants does not implement support for preallocating memory to hold name/Variant pairs that have not been added to the list. Descendant classes that provide support for allocating memory before adding items to the list override GetCapacity to reflect the capacity of the list. 

 

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