Check this from Qlikview help file
If you give SET ErrorMode = 0; then qlikview simply ignores error, if you want the error message then you need to set it as 1
This variable determines what action is to be taken by QlikView when an error is encountered during script execution. By default (ErrorMode=1) the script execution will halt and the user will be prompted for action (non-batch mode). By setting ErrorMode =0 QlikView will simply ignore the failure and continue script execution at the next script statement. By setting ErrorMode =2 QlikView will trigger an "Execution of script failed..." error message immediately on failure, without prompting the user for action beforehand.
Thanks for your reply. I don't want QlikView to throw error, I need to handle the error. Am capturing the error text thru ScriptErrorDetails variable. For all other possible errors it is working fine. But when single quote is missing, this ScriptErrorDetails variable is not capturing the error. But when I check the log file, it is marked as error in the last line
it doesn't produce an error because set vVariable does not interprete the string after the statement (there are exceptions like '$').
Let vError = Num(ScriptError) &' - '& ScriptErrorDetails;
won't work as you do not evaluate the variables like num($(ScriptError)) but qlikview tries to ev. your expression due to let. Also evaluating $(ScriptError) with num does not work as this will return Null-Value if you have text.
As far as I can see, it works the way it should. A missing single quote means that the parser sees the rest of the script as part of the string that is being quoted. Which means that the last Let statement never is executed, because it is part of the string.
If you run the script in the debugger, this is visible:
Of course you could wish that the parser should be "smart" enough to understand that it should skip up until the next semicolon, but then it wouldn't be possible to have semicolons in quoted strings...