Sub DownloadFolder (ServerFolder As String)
FTP.List(ServerFolder)
Wait For FTP_ListCompleted (ServerPath As String, Success As Boolean, Folders() As FTPEntry, Files() As FTPEntry) '<----
If Success Then
For Each f As FTPEntry In Files
FTP.DownloadFile(ServerPath & f.Name, False, File.DirApp, f.Name)
Wait For FTP_DownloadCompleted (ServerPath2 As String, Success As Boolean) '<-----
Log($"File ${ServerPath2} downloaded. Success = ${Success}"$)
Next
End If
Log("Finish")
End Sub