I am calling one function from script. The macro function is very simple:
public function checkFile(filePath)
Dim findFile 'as Boolean
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(filePath) Then
Call objFSO.DeleteFile(filePath)
findFile = 1
Else
'Set objFSO = nothing
findFile = 0
End If
checkFile = findFile
end function
In the scrpit, it was triggered as:
let a = checkFile('$(filePathOfCurrentLoad)');
if $(a) = 1 then
let b = '';
else
let c = '';
endif
The confusing issue is, if the file is in the place of variable filePath, it got delected. However, no matter the file is there or not, the function always return 0.