Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private Label1 As Label
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("1") 'Load the layout file.
MainForm.Show
Dim res As List
res.Initialize
Wait For (CollectFilesAsync("C:\Users\Erel\Documents", res)) Complete (success As Boolean)
Log($"Found :$1.0{res.Size} files"$)
End Sub
Sub CollectFilesAsync(RootFolder As String, List As List) As ResumableSub
Label1.Text = RootFolder
For Each f As String In File.ListFiles(RootFolder)
If File.IsDirectory(RootFolder, f) Then
Sleep(0)
Wait For (CollectFilesAsync(File.Combine(RootFolder, f), List)) Complete (Success As Boolean)
Else
List.Add(File.Combine(RootFolder, f))
End If
Next
Return True
End Sub