Hi,
I've got a piece of code which fills 3 lists with 1. Filename 2. Filetype (directory or not) and 3. file size with the files and directories in a specific path.
Below method works, but does not allow me to sort as then the lists would not be sync'ed anymore.
Is there a way of creating a multidimensional list? I did some research when I had free time at work and found a solution (maybe) with using TYPE and loading these into the lists. However I can not seem to find the post again.
:sign0085:
I've got a piece of code which fills 3 lists with 1. Filename 2. Filetype (directory or not) and 3. file size with the files and directories in a specific path.
Below method works, but does not allow me to sort as then the lists would not be sync'ed anymore.
Is there a way of creating a multidimensional list? I did some research when I had free time at work and found a solution (maybe) with using TYPE and loading these into the lists. However I can not seem to find the post again.
:sign0085:
B4X:
filetype.initialize
filesize.initialize
filelist.initialize
filelist= File.listfiles(Path)
If filelist.IsInitialized Then
For i =0 To filelist.Size-1
If File.IsDirectory(Path, filelist.Get(i)) Then
filetype.Add("Directory")
Else
filetype.Add("Other")
End If
filesize.Add(File.Size(Path, filelist.Get(i)))
Next
Else
If Path.EndsWith("/") AND Path.Length <> 1 Then
Path2 = Path2.SubString2(0,Path2.Length-1)
Path2 = Path2.SubString2(0,Path2.LastIndexOf2("/", Path2.Length))
If Path2 = "" Then Path2= "/"
ToastMessageShow("Error: back", False)
listfoldercontent(Path2)
Else
Path2 = "/"
End If
End If