I have a Xojo program that gets all of the folder names in a specific directory on our company LAN, then lists them in a ComboBox. It is very slow, and takes about 20 seconds to come up with the list. There are about a 130 folders in directory. LAN speeds to that directory are plenty fast, and outputting the names to a text file from scripting is super fast. Is there a more effecient way for me to code this using Xojo?
Here’s the code.
Dim BASE_PATH as string ="\\SERVERNAME\source$\software\WORKSTATION\"
dim VP as FolderItem
VP = GetFolderItem(BASE_PATH)
dim VPArray () as string
Dim VP2 As FolderItem
If VP <> Nil And VP.Directory Then
Dim items As Integer = VP.Count
For i As Integer = 1 To items
VP2 = VP.Item(i)
If VP2.Directory Then
VPArray.addrow(VP2.name)
Else
End
Next
End If
me.addrows(VPArray)
You remove those lines. You need to make a method that matches the Function definition line in the IDE, then paste in the code from the between Function…End Function.
Unfortunately that’s as much as I can help with this. Hopefully someone will join the discussion that has a fast routine for file iteration on Windows.