Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
benoithervochon
Partner - Contributor III
Partner - Contributor III

History of an Exit Scrit that doesn't really exit

Hello all,

recently i faced a problem with usage of must_include mixed after an exit scrit.

Create a simple app with one connector (i've called it TEST) pointing where you want with one qvs file inside 

step1.qvs with code :

 

//First step loaded
Trace --->> Hello World ! <<---;

 

 

In your qlik sense app, add a section after Main with following code :

 

/*
First Must_Include
*/
$(Must_Include=lib://TEST/step1.qvs);
Exit Script;

/*
Second Must_Include that musn't be loaded :
- file dosen't exist
- there is an Exist Script before !!!
*/
$(Must_Include=lib://TEST/step2.qvs);

 

 

Save your app and relaod... tadaaaa

reload fails... 😞

2020-03-27_09h39_48.png

 

So, when you have an Exit Script; in your code, take care of not calling a Must_Include function after it because it can fails reload 😉 (if this must_include isn't working)

Have a nice day, Ben

¯\_(ツ)_/¯
Labels (3)
1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

The exit script stops EXECUTION, but it does not stop PARSING. So you can have syntax errors and the includes will continue be loaded (as the include expansions are part of the parse process). I think that $(include...) and $(must_incude...) will behave similarly in this regard. Although if the file is missing, the straight include will fail silently, while the must_include generates an error message.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

The exit script stops EXECUTION, but it does not stop PARSING. So you can have syntax errors and the includes will continue be loaded (as the include expansions are part of the parse process). I think that $(include...) and $(must_incude...) will behave similarly in this regard. Although if the file is missing, the straight include will fail silently, while the must_include generates an error message.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
benoithervochon
Partner - Contributor III
Partner - Contributor III
Author

I was thinking that an Exit Script should stop parsing the code...that's not the case totally agree

Is there another option to avoid this kind of problem ? (/ex an app with old code archived  in a section in app after the exit script; )

¯\_(ツ)_/¯
benoithervochon
Partner - Contributor III
Partner - Contributor III
Author