I want to use multi TList in Delphi. For example:
var
temp1List : TList;
temp2List : TList;
begin
temp1List := TList.Create;
temp2List := TList.Create;
temp1List.add(temp2List);
end;
I think it is not correct because TList accepts parameter as Pointer value.
Is there way to use multi TList?
Have a look at the Generic
TList<T>instead, eg:Alternatively, since
TListis a class type, you can useTObjectList<T>instead, and take advantage of itsOwnsObjectsfeature: