Re: Speedsorts with pointers or anything else?

Posted by webmaster Guido on April 24, 2001 at 05:09:50:

In Reply to: Speedsorts with pointers or anything else? posted by Peter de Jong on April 19, 2001 at 15:18:06:

: I need to have a constantly sorted list of fast changing records (many additions and deletions in the list).
: In the old days (TurboPascal) that was done in a pointerstructure.
: How can I solve this best in Delphi 5?

Try a TStringList, a list of strings. It has a "Sorted" property, that activates a very fast built-in sort routine.

If you have additional fields in the records: you can attach an object to each element of the TStringList.

In the 32bit-Delphi versions, there is no theoretical limit for a StringList, not for the amount of string-items nor for the length of each string. But Windows will say "out of resources" when items*itemlength is too big. Testing has shown that this is over 16 MB on a Win98 system with Delphi 4 (maybe it's a lot higher, any volunteers to test this?)

Related Articles and Replies: