Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

michielvandegoo
Valued Contributor

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.

Tags (2)
1 Solution

Accepted Solutions
gardenierbi
Contributor

Re: CALL parameters reusable?

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'.

3 Replies

Re: CALL parameters reusable?

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
Contributor

Re: CALL parameters reusable?

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'.

michielvandegoo
Valued Contributor

Re: CALL parameters reusable?

gardenierbi , looks promising but I need to test this.

Thanks!

Community Browser