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

# TCollection.SetItem

Write handler for the TCollection.Items property.

## Declaration

`protected procedure TCollection.SetItem(`
`Index: Integer;`
`Value: TCollectionItem`
`);`

## Description

SetItem implements the write handler for the TCollection.Items property. It assignes Value to the Index-th element in the array. For this to work properly, the TPersistent.Assign method of the Item must work correctly.

## Errors

If Index is outside the allowed range, then an EListError exception is raised.

## See also

TCollection.Items |  | Indexed array of items in the collection.
TCollection.Count |  | Number of items in the collection.
TCollection.GetItem |  | Read handler for the TCollection.Items property.