TList<T>.Items#
Lê ou substitui o elemento no índice informado. Items é o indexador padrão.
Declaração#
property Items[Index: Integer]: T read write; default;Exemplo#
var Values: TList<Integer>;
begin
Values := TList<Integer>.Create;
Values.Add(10);
Values.Add(20);
Values[1] := 25;
WriteLn(IntToStr(Values.Items[1]))
end.Resultado esperado: 25.
Os índices começam em zero. Leitura ou escrita fora do intervalo produz uma exceção tratável e não aumenta a lista; use Add ou Insert para criar posições.