Questions tagged [tlist]

Delphi VCL class for a list of pointers.

TList is a list of pointers in Delphi VCL. TList has been available in the VCL since Delphi 1 and it provides a base for various lists.

78 questions
38
votes
1 answer

Delphi XE8 bug in TList, need workaround

After upgrading to XE8 some of our projects start to break data. Looks like a bug in TList realization. program XE8Bug1; {$APPTYPE CONSOLE} uses System.SysUtils, Generics.Collections; type TRecord = record A: Integer; B: Int64; …
BofA
  • 823
  • 7
  • 16
35
votes
8 answers

Delphi TList of records

I need to store a temporary list of records and was thinking that a TList would be a good way to do this? However I am unsure how to do this with a TList and was wondering if this is the best was and also if anyone has any examples of how to do…
colin
  • 2,793
  • 6
  • 37
  • 48
16
votes
5 answers

Clear a TList or a TObjectList

I'm a bit puzzled of what to use for storing objects in a list. Until now I have used TList and freed each item in a loop. Then I discovered TObjectList that do this automatically from Free. Then I saw this from the doc of TList.Clear: Call Clear…
Roland Bengtsson
  • 4,902
  • 8
  • 53
  • 89
12
votes
2 answers

Viewing the Process Tree - tlist/tasklist

Starting with windows xp, the tlist command was replaced by the tasklist command. The old tlist command had the option \t, which permitted to query parent/child process relationship. Does a similar option exist in tasklist? Thank you
Yakov
  • 8,699
  • 25
  • 100
  • 182
10
votes
3 answers

How do I search a generic TList collection?

Possible Duplicate: How can I search a generic TList for a record with a certain field value? I have a collection of TList TActivityCategory has a Name property of type string and I want to search the TList using the Name…
Thomas Jaeger
  • 851
  • 8
  • 25
9
votes
6 answers

What is an efficient way of deleting a large block of items from the start of a TList in Delphi

Delete (0) from a TList is expensive because all the subsequent items need to be moved down. If I need to delete a large number of items from the start of an even larger list what's the fastest way?
rossmcm
  • 5,184
  • 7
  • 51
  • 108
8
votes
8 answers

How noticeable is the difference of performance among TList, TObjectList, and plain array, if it could be estimated?

*Summarization: Please check the knowledgeable comments from the Delphi experts. Specifically for me, I would try to use old TList/TObjectList as David suggested, and use hard-cast and TObjectList.List property as A.Bouchez suggested. I will try…
SOUser
  • 3,683
  • 4
  • 30
  • 58
8
votes
4 answers

Why is TList.Remove() producing an EAccessViolation error?

Why EAccessViolation is raised when executing the code below? uses Generics.Collections; ... var list: TList; ... begin list := TList.Create(); try list.Add(myNotifyEvent); …
yippee
6
votes
2 answers

In Delphi are reads on TList thread safe?

I've built a simple logging class and want to confirm that it is thread safe. Basically the Log, RegisterLogger and UnRegisterLogger will be called from different threads. Log will be called alot (from many different threads) and RegisterLogger…
Alister
  • 6,137
  • 4
  • 37
  • 63
6
votes
2 answers

Delphi TList in multithreading

Is it safe to use TList in a multithreaded application which is accessed by all the other threads but only one thread writes to it. the scenario is A unique TList to each thread which only that thread will write to while other threads will just…
Junaid Noor
  • 464
  • 8
  • 23
5
votes
1 answer

Delphi TList generics

Can someone explain to me if this is possible, or I'm completely missunderstanding this Delphi feature. Let's say I have a class, I create a few of them, and then add them to an ObjectList. Normally I do it like this: Type TMyClass = class(TObject) …
hikari
  • 3,174
  • 27
  • 64
5
votes
1 answer

generic TList of records with a sub list?

I want to use a generic TList of records with a sub list in Delphi XE5: type TMyRecord=record Value1: Real; SubList: TList; end; TMyListOfRecords=TList; var MyListOfRecords: TMyListOfRecords; Assignments to the…
user3384674
  • 689
  • 5
  • 21
4
votes
1 answer

How do I add records of type record to a TList<>?

I have a treelist of data. I'm looping through the tree list to match certain records and adding them to a generic TList<>. This works except all record values become the last one added for all items in the TList. Here's some code: type TCompInfo…
jwilfong
  • 45
  • 1
  • 5
4
votes
1 answer

How to look into generic tList during Delphi debugging

I use Delphi 10.3.1 COMMUNITY version and can't look into generic tList while I debug the project. I know the latest version of Delphi doesn't support the old-typed debug feature which allows to look into generic tList. So I used tList.List in the…
SHIN JaeGuk
  • 398
  • 3
  • 13
4
votes
1 answer

Long delay when looping through a TList of big records

I use Delphi 10.1 Berlin in Windows 10. I have two records of different sizes. I wrote code to loop through two TList of these records to test elapsed times. Looping through the list of the larger record runs much slower. Can anyone explain the…
JO SeongGng
  • 537
  • 2
  • 14
1
2 3 4 5 6