Fast binary sort for strings in a list?

Just starting out? Need help? Post your questions and find answers here.
camille
User
User
Posts: 73
Joined: Tue Nov 19, 2019 12:52 pm

Fast binary sort for strings in a list?

Post by camille »

Hello :D

Has anyone ever written a fast sort function (for strings inside a list) for Windows that compares by character value?
Which means that e.g.:

Code: Select all

! < ... < A < B ...< \ ... < a < b ... <  } ...
It would be cool if this would be UTF-8 compatible...

The normal SortList() doesn't work this way and something like:

Code: Select all

SELECT * FROM temp ORDER BY FullPath COLLATE BINARY ASC
within SQLite sorts differently as well...

Regards,
camille
AZJIO
Addict
Addict
Posts: 2183
Joined: Sun May 14, 2017 1:48 am

Re: Fast binary sort for strings in a list?

Post by AZJIO »

Show your example with SortList. I did it and it works for me. I want to see yours.
camille
User
User
Posts: 73
Joined: Tue Nov 19, 2019 12:52 pm

Re: Fast binary sort for strings in a list?

Post by camille »

:oops: Don't ask me why but now it works here as well...

I'm getting old I fear :shock:

Thank you, AZJIO!
User avatar
skywalk
Addict
Addict
Posts: 4215
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Fast binary sort for strings in a list?

Post by skywalk »

Search forum for qsort and custom callback.
Nothing is faster.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Post Reply