Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Running the following QlikView script produces an error message:
Set a = 0;
If false() then
Set a = 1;
$(must_include=C:\file.txt);
End if
Script Error: $(MUST_INCLUDE failed: C:\file.txt
Note that:
This looks as if the command $(must_include=file.txt); is not executed. Otherwise, a would have to be set to 2, when C:\file.txt exists and contains Set a= 2;. This is the expected behaviour, since none of the commands between If false() then and End if should be executed.
Still, $(must_include=file.txt); produces an error message, when the C:\file.txt does not exist, although the command is not executed. It cannot be a syntax error, since the error message is thrown depending on whether C:file.txt exists, not depending on the syntax. Is this intended behaviour or a bug? Is $(MUST_INCLUDE failed: C:\file.txt a run-time error or a compilation error?
To me it looks like a bug. The bug is a problem in a script like this:
If condition then
$(must_include=a.txt);
Else
$(must_include=b.txt);
End if
This script always produces an error message, when either a.txt or b.txt does not exist, even if, for the script to work, it is not necessary that a.txt and b.txt exist.
estou com mesmo problema tentando usar tanto com IF, THEN,ELSE ou com SWITCH CASE...
The include is not a statement. It is a macro expansion.
This means that the $(...) construct is replaced by the file before the parsing of the script. It is hence not "executed" at run-time, and therefore, the If-statement is irrelevant.
So I would not consider this a bug.