• Page:
  • 1

TOPIC: How to change sort mode on SysUtils.FindFirst

How to change sort mode on SysUtils.FindFirst 5 months 1 week ago #14024

Hello,
I want to get alist of folders with SysUtils.FindFirst. I use unicode strings with East European chars.

The available directories are sorted e.g.
A...
B...
...
Y
Z
but then follow all Special signs
like
Åberg
Šmalcelj.

I would like to have Åberg after A and not after Z.

Sincerely Peter

Please Log in or Create an account to join the conversation.

How to change sort mode on SysUtils.FindFirst 5 months 6 days ago #14031

From the MSDN entry on FindNextFile: "The order in which the search returns the files, such as alphabetical order, is not guaranteed, and is dependent on the file system. If the data must be sorted, the application must do the ordering after obtaining all the results.".

Please Log in or Create an account to join the conversation.

How to change sort mode on SysUtils.FindFirst 5 months 6 days ago #14033

Peter wrote: The available directories are sorted e.g.
A...
B...
...
Y
Z
but then follow all Special signs
like
Åberg
Šmalcelj.

I would like to have Åberg after A and not after Z.


FindFirst() does not provide any kind of sorting capabilities. It returns entries in whatever order the filesystem provides. You will have to store the entries in a TStringList and then sort that as desired.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: April Anne