Folderitem Directory Sort

  1. 2 years ago

    Jordan D

    7 Dec 2017 Pre-Release Testers, Xojo Pro

    Hi all!

    I'm reading a directory...something like:

     
    for i as integer = 1 to f.count
        tmp file = f.item(i).name
       ....
    next

    I'm curious, in that the names of the files were in alphabetical order at one point. Now, it looks like the files are not. What happened?
    How do I get it to deliver the files in alphabetical order?

    I know I read into an array and then sort, but it's not something I had to do before.

    Thanks!

    The order is not guaranteed.

    MacOS used to return them sorted, but that is not done for APFS.
    But you can put them in an array as well as their names and use Array.SortWith function.

  2. Christian S

    7 Dec 2017 Pre-Release Testers, Xojo Pro, XDC Speakers Answer Germany

    The order is not guaranteed.

    MacOS used to return them sorted, but that is not done for APFS.
    But you can put them in an array as well as their names and use Array.SortWith function.

  3. Jordan D

    9 Dec 2017 Pre-Release Testers, Xojo Pro

    Got it. Thanks!

or Sign Up to reply!