Hi All,
I am trying to use DonManfreds WIldCardListing class to get a List of files to be shown in a listview for selection.
WCL itself seems to be working but I am failing to get the list to the Listview.
WCL correctly produces the FileListing list in the sub wcl_ListFilesFinish. To make it available to other subs I copy it to FileListing1, a list Dimmed in Sub Globals.
This copying is confirmed at the end of Sub wcl_ListFilesFinish by Log(FileListing1.Size) showing the correct size.
The same Log in the sub where FileListing1 is to be used to populate the Listview the size always shows size as zero.
Thanks in advance
Regards Roger
I am trying to use DonManfreds WIldCardListing class to get a List of files to be shown in a listview for selection.
WCL itself seems to be working but I am failing to get the list to the Listview.
WCL correctly produces the FileListing list in the sub wcl_ListFilesFinish. To make it available to other subs I copy it to FileListing1, a list Dimmed in Sub Globals.
This copying is confirmed at the end of Sub wcl_ListFilesFinish by Log(FileListing1.Size) showing the correct size.
The same Log in the sub where FileListing1 is to be used to populate the Listview the size always shows size as zero.
B4X:
Sub Import_click
'Some code stuff
If ExFileName_flag = 0 Then
wcl.ClearLists ' Clears the Dir- and Filelisting lists which will be used in Events
wcl.ListFiles(File.DirRootExternal & "/Download/",True, "*.txt",True, True)
Log("Filelisting1 size = " & FileListing1.Size) 'Always Logs "Filelisting1 size = 0"
'Code stuff
End If
'More code stuff
End Sub
Sub wcl_ListFilesFinish(FileListing As List) 'Event called by wcl.ListFiles
Log("wcl_ListFilesFinish("&FileListing.Size&")")
Dim TempF As String
For i = 0 To FileListing.Size -1
' Log(FileListing.Get(i))
Next
FileListing1.Clear
For i = 0 To FileListing.Size -1 'Copy FileListing to FileListing1
TempF = FileListing.Get(i)
FileListing1.Add(TempF)
Next
Log(FileListing1.Size) 'Always shows correct size. Copy works
End Sub
Thanks in advance
Regards Roger