Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Troubles including scripts containing "SUB" statements

I am trying to modularize a bit my report, and when I try this in my master script :

SUB GenerateStuff (a, b)

// Do stuff

END SUB

LET a=foo;

LET b=bar;

CALL GenerateStuff('$(a)', '$(b)');

It works perfectly. If I put the SUB...END SUB block in an external file and do this :

$(Include='external.script')
LET a=foo;

LET b=bar;

CALL GenerateStuff('$(a)', '$(b)');

The CALL to my GenerateStuff subroutine fails miserably.

Am I missing something here ?

4 Replies
Not applicable
Author

I really don't see how to make it work... Quite a pain...

Not applicable
Author

You don't need quotes when using include. Also, make sure to include any file extension (.qvs is the normal extension).

For example:

$(Include=external.script.qvs);

Not applicable
Author

The include part is actually called through a variable :

$(Include=$(File))

Where File is the path to the file to be loaded.

The File actually loads and the script is run (verified by a trace), but the SUB routine isn't callable.

If I copy/paste the exact SUB...END SUB block in the main script, it *is* callable.

Weird...

vadimtsushko
Partner - Creator III
Partner - Creator III

Take a look at qlikview-components.

Itis whole library in include script - and it works.