I am using sFTP to get the folders and files from a given serverpath.
The strange thing is that the folders and files are listed in a random order.
Is there any way that the folders and the files can be sorted in alphanumeric order?
Below is the code that I am using to display the folders and files on an Android Tablet.
Can someone lead me in the right direction to solve this problem and make the correct changes to my code?
I am not an expert in this matter so any help would be helpfull.
The strange thing is that the folders and files are listed in a random order.
Is there any way that the folders and the files can be sorted in alphanumeric order?
Below is the code that I am using to display the folders and files on an Android Tablet.
Can someone lead me in the right direction to solve this problem and make the correct changes to my code?
I am not an expert in this matter so any help would be helpfull.
B4X:
Sub sFTP1_ListCompleted (ServerPath As String, Success As Boolean, Folders() As SFtpEntry, Files() As SFtpEntry)
strServerDir = ServerPath
If Success = False Then
Flag_Verbinding = False
MsgboxAsync("No Connection", "NO CONNECTION")
Activity.Finish
Else
Flag_Verbinding = True
If strServerDir <> "/" Then
lvServer.AddTwoLinesAndBitmap2(".."," UP",bmpFolderUp,"U$..")
End If
For i = 0 To Folders.Length - 1
lvServer.AddTwoLinesAndBitmap2(Folders(i).Name,"",bmpFolder,"D$" & Folders(i).Name)
Next
For i = 0 To Files.Length - 1
lvServer.AddTwoLinesAndBitmap2(Files(i).Name,NumberFormat(( (Round(Files(i).Size / 102.4)/10) ),0,1) & " K " & DateTime.Date(Files(i).Timestamp),bmpFile,"F$" & Files(i).Name & "$" & Files(i).Size)
Next
End If
End Sub