Board index » delphi » String list sort does not appear to work?

String list sort does not appear to work?

I have a problem with sorting string lists, ListBoxes or StringLists seem to
act the same.  On a couple of occasions I have needed to sort text files with
a fairly large number of lines (say a couple of thousand) alphabetically.  If
I read them into a "sorted" list, the duplicates are not always next to each
other, some are a couple of positions away from where they should be.  Has
anyone else experienced this problem or have any ideas.

Trevor Hand

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

 

Re:String list sort does not appear to work?


Trevor,

Can you post a couple of examples of lines that are incorrect?

TIP: Load the stringlist with Sorted := False, and then set Sorted
to True; the stringlist will load 10x faster.

Ken
---
Ken White

Clipper Functions for Delphi
http://members.aol.com/clipfunc

Quote
t.h...@trl.telstra.com.au wrote:

> I have a problem with sorting string lists, ListBoxes or StringLists seem to
> act the same.  On a couple of occasions I have needed to sort text files with
> a fairly large number of lines (say a couple of thousand) alphabetically.  If
> I read them into a "sorted" list, the duplicates are not always next to each
> other, some are a couple of positions away from where they should be.  Has
> anyone else experienced this problem or have any ideas.

> Trevor Hand

> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

Other Threads