IStringList.Capacity

Syntax

Capacity: Integer;

Description

The Capacity property determines the size of memory that is allocated for array elements.

Comments

In fact, the Capacity property determines number of elements, which can be placed to the array without complementary memory allocation. The Capacity property value is always greater or equal the Count property value. If Count on element adding becomes greater than Capacity, memory size will be automatically increased.

If value of allocated memory is significantly greater than the number of added array elements, the TrimToSize method can be used or the Capacity property can be set to Count. The memory needed to store the array will be also automatically reallocated.

See also:

IStringList