tlist

extract an object from a TObjectList

I have a TObjectList with OwnsObjects = true. It contains quite a few objects. Now I want to remove the object at index Idx from that list, without freeing it. Is the Extract method the only option? ExtractedObject := TheList.Extract(TheList[Idx]); All other methods seem to free the object. I am looking for something a little bit more...

Replacement for TList in Delphi Prism.

Hello, I am migrating an application written in Delphi 2007 to Delphi Prism, which is the best option to replace the TList class? Thanks in advance. Bye. ...

Strange EListError occurance (when accessing variable-defined index)

Hi, I have a TList which stores some objects. Now I have a function which does some operations on that list: function SomeFunct(const AIndex: integer): IInterface begin if (AIndex > -1) and (AIndex < fMgr.Windows.Count ) then begin if (fMgr.Windows[AIndex] <> nil) then begin if not Supports(TForm(fMgr.Windows[AIndex...

Result := TList<Something>.Create

I'm trying to write a Delphi function that returns a TList<TMyType> object. But I see that Result := tlist_instance doesn't work. What's the function to do my work? ...

How to sort a Typed Tlist

I have a number of Typed TLists which I am having problems getting to sort Normally, for an untyped TList, I would have a function such as: function SortByJob(Item1: Pointer; Item2: Pointer): Integer; var p1, p2: JobPointer; begin p1 := JobPointer(Item1); p2 := JobPointer(Item2); if p1.job > p2.job then Result := 1 ...

Delphi's TDictionary, my Value objects are inserting as null.

Hi all, I'm using Delphi 9's TDictionary generic class. My TDictionary looks like this: g_FileHandlers : TDictionary<String, TList<String>>; And, so I initialize the TDictionary like so: g_FileHandlers := TDictionary<String, TList<String>>.Create; I have a TList, that I'm also initializing, so that I can use it to populate the TDi...