[Overview][Constants][Types][Classes][Procedures and functions][Variables] | Reference for unit 'Classes' (#fcl)

# TStrings.SetCapacity

Write handler for the TStrings.Capacity property.

## Declaration

`protected procedure TStrings.SetCapacity(`
`NewCapacity: Integer`
`); virtual;`

## Description

SetCapacity is the write handler for the TStrings.Capacity property. The TStrings implementation of SetCapacity does nothing.

Descendent classes can override this method to set the current capacity of the stringlist to NewCapacity. The capacity is the number of strings the list can hold before it tries to expand its storage space. NewCapacity should be no less than Count.

## See also

TStrings.Capacity |  | Capacity of the list, i.e. number of strings that the list can currently hold before it tries to expand.
TStrings.GetCapacity |  | Abstract Read handler for the TStrings.Capacity property.