TStrings.Objects

Indexed access to the objects associated with the strings in the list.

Declaration

Source position: classesh.inc line 779

public Property
  Objects[Index: Integer]: TObject;

Description

Objects provides indexed access to the objects associated to the strings in the list. Index is a zero-based index and must be in the range of 0 to Count-1.

Setting the objects property will not free the previously associated object, if there was one. The caller is responsible for freeing the object that was previously associated to the string.

TStrings does not implement any storage for objects. Reading the Objects property will always return Nil, Setting the property will have no effect. It is the responsibility of the descendant classes to provide storage for the associated objects.

Errors

If an Index outside the valid range is specified, an EStringListError exception will be raised.

See also

Name Description
TObject Base class of all classes.
TStrings.IndexOfObject Finds an object in the list and returns its index.
TStrings.Names Name parts of the name-value pairs in the list.
TStrings.Strings Indexed access to the strings in the list.
TStrings.Values Value parts of the name-value pairs in the list.