Skip to main content

Suggest an Idea

Vote for your favorite Qlik product ideas and add your own suggestions.

Make "exit script;" exiting script. For real.

simonaubert
Partner - Specialist II
Partner - Specialist II

Make "exit script;" exiting script. For real.

Hello,

Exit script is a very useful instruction to exit the execution of a script. As a example, I use it a lot instead of commenting several sections.
However, it appears tthat the code is still parsed... and throws errors !!!

Especially Must-Include which is still executed.

image.png

 

 

I lost hours trying to understand why and this is everything but :

1/very dangerous
2/unnatural

Please make Make "exit script;" exiting script for real.

 

Best regards,

Simon

Bi Consultant (Dataviz & Dataprep) @ Business & Decision
Tags (2)
7 Comments
AndrewMcIlwrick
Luminary Alumni
Luminary Alumni

Must_include is a dollar sign expansion of a system variable so will always take place before any script execution. Even its peer of "include" would also fail in such cases. It's objecting to the syntax of the connection, path and file rather than the underlying QVS itself.

I have seen your problem in several customer apps. It was frustrating when references to included scripts failed but you didn't care. Through due diligence, use of GIT and cleverly mapped app configuration we were able to ensure that scripts were virtually guaranteed to execute without error - especially in higher environments.

One other thing to watch out for is that if you exit the script the calling task may see this as a normal execution stop and report success. There are tricks such as wrapping the EXIT routine with a command that is syntactically incorrect etc, and others. I am sure there are loads of examples on like Qommunity to trap exceptions in clean ways but that was the approach I always took.

simonaubert
Partner - Specialist II
Partner - Specialist II

Hello,

I don't follow you there

 


One other thing to watch out for is that if you exit the script the calling task may see this as a normal execution stop and report success.

I don't want exit script to generate an error, it's a perfectly legit stop 🙂


Through due diligence, use of GIT and cleverly mapped app configuration we were able to ensure that scripts were virtually guaranteed to execute without error - especially in higher environments


Actually I don't have the issue in production environment, just in development.. but as mentioned : it's not natural.

Best regards,

Simon

AndrewMcIlwrick
Luminary Alumni
Luminary Alumni

Basically when you execute a script all variable references are resolved. "Must_Include" is the same - so irrespective of any control statements or exits in the code, the Includes must work or it will abort - yes it's annoying but it's the intended behaviour. Happy to "escalate" to Qlik for you but I suspect you will receive the same.

ADAAuditing
Partner - Contributor
Partner - Contributor

awefwefwefv

ADAAuditing
Partner - Contributor
Partner - Contributor

🤗🐵i am

Patric_Nordstrom
Employee
Employee

@AndrewMcIlwrick explains, this is the intended behavior.

Thanks,

Patric

Status changed to: Open - Not Planned
Meghann_MacDonald

Archiving due to relevance & time.

Meghann

Status changed to: Closed - Archived