TList<T>.Add#
Adiciona o valor ao final e retorna seu índice.
Declaração#
function Add(const Value: T): Integer;Exemplo#
var
Values: TList<Integer>;
begin
Values := TList<Integer>.Create;
WriteLn(IntToStr(Values.Add(10)));
WriteLn(IntToStr(Values.Add(20)))
end.Resultado esperado: 0 e 1.
A inclusão respeita MaxArrayLength e MaxMemoryBytes. O argumento precisa ser compatível com T.