Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-08

TStringList alternatives?

4 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Landmesser John

i use TStringList to store about 100.000 values.

That's ok, but i would like to know if there are better ways to do that?

I have Values from a Oracle Database with Row-Id's like 2016070502523396 HTCSFVRY

My StringList is sorted, to do a quick IndexOf()

I would need add and IndexOf()

What about VirtualTree? TList ... ?

advices are welcome :-))

Reply by email

Xiangrong Fang
to Landmesser John

Have a look at my generic TVector implementation, written from scratch, based on dynamic array:

https://github.com/xrfang/fpcollection/blob/master/src/units/vector.pas

Regards.

Landmesser John wrote 22 lines
i use TStringList to store about 100.000 values. That's ok, but i would like to know if there are better ways to do that? I have Values from a Oracle Database with Row-Id's like 2016070502523396 HTCSFVRY My StringList is sorted, to do a quick IndexOf() I would need add and IndexOf() What about VirtualTree? TList ... ? advices are welcome :-)) -- _______________________________________________ Lazarus mailing list http://lists.lazarus-ide.org/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160804/a04d07ca/attachment.html>

Reply by email

leledumbo
to Landmesser John: i use TStringList to store about 100.000 values. That's ok, but i would like to know if…
I would need add and IndexOf()

Fast insertion, fast retrieval, definitely a hash table / map. Follow Denis suggestion. I personally prefers fcl-stl's ghashmap (THashmap), but any other similar classes will do.

View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-TStringList-alternatives-tp4049257p4049268.html Sent from the Free Pascal - Lazarus mailing list .

Reply by email