Hi to everybody,
I am trying to copy files with File.Copy starting a background process with Threading library but i recibe an error "Exception : argument type mismatch".
Here is my code:
Attached there is a project example
Thanks in advance
I am trying to copy files with File.Copy starting a background process with Threading library but i recibe an error "Exception : argument type mismatch".
Here is my code:
B4X:
If Thread1.Start(Me, "CopyFile", Array As String(sPath, sFile, tPath, tFile)) Then
Timer1.Enabled = True
End If
Sub CopyFile(Path1 As String, File1 As String, Path2 As String, File2 As String)
File.Copy(Path1, File1, Path2, File2)
End Sub
Sub Thread1_Ended(endedOK As Boolean, error As String) 'The thread has terminated. If endedOK is False error holds the reason for failure
Timer1.Enabled = False
If endedOK Then
fx.Msgbox(MainForm, "One file copied Ok", "FileCopy")
Else
fx.Msgbox(MainForm, error, "Oooops")
Log(error)
End If
End Sub
Attached there is a project example
Thanks in advance