Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Michiel_QV_Fan
Specialist
Specialist

CALL parameters reusable?

Can CALL parameters be reused by creating variables from them?

If I have something like this:

CALL ListFiles('C:\downloads') the parameter is, I guess, a 1 time variable? Or is it reusable in some way?

It is of course possbile to do it this way:

SET _location = C:\downloads and then CALL ListFiles('$('_location ') but then the variables have to be added extra as scripting parameters which I don't want.

1 Solution

Accepted Solutions
gardenierbi
Creator II
Creator II

michielvandegoor‌, sub parameters are only available within the sub you're using them.

Is this something you can use :

SUB ListFiles(pLocation, pReturnValue)

      // Do something

      LET $(pReturnValue) = '$(pLocation)';


END SUB

CALL ListFiles('C:\downloads', 'vLocation')

After using this call statement there is a variable with the name 'vLocation'.

View solution in original post

3 Replies
marcus_sommer

I don't think that this will be possible - you will need to go the extra step and create (and probably delete) these variables within the script - for this could be include-variables quite helpful: The $(Include) which you $(Must_Include) into your toolkit.

- Marcus

gardenierbi
Creator II
Creator II

michielvandegoor‌, sub parameters are only available within the sub you're using them.

Is this something you can use :

SUB ListFiles(pLocation, pReturnValue)

      // Do something

      LET $(pReturnValue) = '$(pLocation)';


END SUB

CALL ListFiles('C:\downloads', 'vLocation')

After using this call statement there is a variable with the name 'vLocation'.

Michiel_QV_Fan
Specialist
Specialist
Author

gardenierbi , looks promising but I need to test this.

Thanks!