About 5 years ago the sort function in Xojo was updated to allow the use of a Delegate method to sort objects in an array (2015R3). So the way I do this is:
[code]Public Function SortFilesByName(Value1 As FolderItem, Value2 As FolderItem) as Integer
If Value1.Name > Value2.Name Then
If Value2.Name > Value1.Name Then
This is my sort function and I use this with
[code]// Load a table of the contents of f
Dim Files() As FolderItem
For i As Integer = 0 To f.Count - 1
Where f is the folder I want sorted.
You’ll notice this is just like using custom sort on a listbox column.
I could also create delegate methods to sort by createddatetime or modifieddatetime or even size (which would require creating a binary input stream for each file and comparing the length of each stream) and then just use the delegate of choice to get the result I desired.