I want to scan a folder and its subfolders for files and add them to the list.
The files of the main folder are added nicely, then the function calls itself (tested it) with the path for the subfolder (its correct, i also tested it), but nothing happens. There is no error but it just doesnt work. Any Ideas?
Function LoadFiles with parameters “path as String”:
Dim testFolder As New FolderItem(path,FolderItem.PathTypeAbsolute)
If testFolder Is Nil Then
Return
End If
Dim count As Integer = testFolder.Count
For i As Integer = 1 to count
Dim f As FolderItem = testFolder.Item(i)
If f <> Nil Then
if f.Directory = false then
lstTableFiles.AddRow(f.Name)
else
LoadFiles(Str(path+f.Name))
end
End If
Next
@Tue Sandbæk He is passing the path and creating a folder each time. In your other thread, you seem to be passing the folderitem itself. I suggested a fix for that.