RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TAbstractNamedVariants.SetCapacity Method

Sets the value of the Capacity property.

Pascal
procedure SetCapacity(NewCapacity: Integer); virtual;
C++
virtual __fastcall SetCapacity(int NewCapacity);

SetCapacity is the protected write implementation of the Capacity property. 

In TAbstractNamedVariants, SetCapacity does nothing, 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 SetCapacity to reallocate the memory used to hold list items. 

 

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