<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Matching quotes in non-expression contexts in Archived Groups</title>
    <link>https://community.qlik.com/t5/Archived-Groups/Matching-quotes-in-non-expression-contexts/m-p/646840#M4347</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMO, it is a QlikBug (in QlikView 10 &amp;amp; 11) that the QlikView Script engine and editor both attempt to treat the single-quote character as a string delimiter even in contexts where it doesn't make sense i.e. contexts that do not take an expression.&amp;nbsp; Two particular such contexts in which I have had to struggle with this issue are the TRACE and EXEC statements.&amp;nbsp; So, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;SUB print(p)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace $(p);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;ENDSUB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;LET vFilename='May'&amp;amp;chr(39)&amp;amp;'04.csv';&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;TRACE&amp;nbsp; vFilename=$(vFilename);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;CALL print((3.14)); // this does not get executed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;TRACE ';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;CALL print((2.71)); // this does get executed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The TRACE statement does not take an expression, and yet QlikView trips-up on this sample.&amp;nbsp; Having substituted in vFilename's value and discovered the single quote character, it treats it as the opening delimiter of a string and proceeds to gobble-up all subsequent script until it finds another single quote i.e. in the next TRACE statement.&amp;nbsp; Consequently, the first CALL becomes part of the first TRACE statement's text (and therefore is outputted and not executed), and the second CALL gets executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A slightly more exciting example is this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;TRACE vFilename=$(vFilename);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;CALL print(';abc'); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here, "CALL print(';" is treated as part of the TRACE statement, and QV attempts to treat "abc')" as a separate statement - and, failing, crashes-out of the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone else felt the pain? Is this a bug?&amp;nbsp; Would it break anything if the script engine was smarter about this?&amp;nbsp; And what other statements are contexts where expressions are not parsed and therefore quotes shouldn't be either?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Angus.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2025 14:48:52 GMT</pubDate>
    <dc:creator>gussfish</dc:creator>
    <dc:date>2025-07-23T14:48:52Z</dc:date>
    <item>
      <title>Matching quotes in non-expression contexts</title>
      <link>https://community.qlik.com/t5/Archived-Groups/Matching-quotes-in-non-expression-contexts/m-p/646840#M4347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMO, it is a QlikBug (in QlikView 10 &amp;amp; 11) that the QlikView Script engine and editor both attempt to treat the single-quote character as a string delimiter even in contexts where it doesn't make sense i.e. contexts that do not take an expression.&amp;nbsp; Two particular such contexts in which I have had to struggle with this issue are the TRACE and EXEC statements.&amp;nbsp; So, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;SUB print(p)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace $(p);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;ENDSUB&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;LET vFilename='May'&amp;amp;chr(39)&amp;amp;'04.csv';&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;TRACE&amp;nbsp; vFilename=$(vFilename);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;CALL print((3.14)); // this does not get executed&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;TRACE ';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;CALL print((2.71)); // this does get executed&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The TRACE statement does not take an expression, and yet QlikView trips-up on this sample.&amp;nbsp; Having substituted in vFilename's value and discovered the single quote character, it treats it as the opening delimiter of a string and proceeds to gobble-up all subsequent script until it finds another single quote i.e. in the next TRACE statement.&amp;nbsp; Consequently, the first CALL becomes part of the first TRACE statement's text (and therefore is outputted and not executed), and the second CALL gets executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A slightly more exciting example is this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080;"&gt;TRACE vFilename=$(vFilename);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;CALL print(';abc'); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here, "CALL print(';" is treated as part of the TRACE statement, and QV attempts to treat "abc')" as a separate statement - and, failing, crashes-out of the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone else felt the pain? Is this a bug?&amp;nbsp; Would it break anything if the script engine was smarter about this?&amp;nbsp; And what other statements are contexts where expressions are not parsed and therefore quotes shouldn't be either?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Angus.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2025 14:48:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Archived-Groups/Matching-quotes-in-non-expression-contexts/m-p/646840#M4347</guid>
      <dc:creator>gussfish</dc:creator>
      <dc:date>2025-07-23T14:48:52Z</dc:date>
    </item>
  </channel>
</rss>

