Unit 'Classes' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#rtl]

TFPList.Capacity

Current capacity (i.e. number of pointers that can be stored) of the list.

Declaration

Source position: classesh.inc line 552

public property TFPList.Capacity : Integer
  read FCapacity
  write SetCapacity;

Description

Capacity contains the number of pointers the list can store before it starts to grow.

If a new pointer is added to the list using add or insert, and there is not enough memory to store the new pointer, then the list will try to allocate more memory to store the new pointer. Since this is a time consuming operation, it is important that this operation be performed as little as possible. If it is known how many pointers there will be before filling the list, it is a good idea to set the capacity first before filling. This ensures that the list doesn't need to grow, and will speed up filling the list.

See also

SetCapacity

Count

  

Current number of pointers in the list.


Documentation generated on: Nov 23 2024