Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro always return 0

Hello Expert,

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.

Any suggestions?

Many thanks

HTC

0 Replies