<?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 Re: Trace statement with nested brackets turns following load script into comments in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045676#M86010</link>
    <description>&lt;P&gt;Fascinating!&lt;/P&gt;
&lt;P&gt;This works:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;trace ABC]];&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;But this is not working:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;trace [ABC]];&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Mar 2023 14:31:53 GMT</pubDate>
    <dc:creator>henrikalmen</dc:creator>
    <dc:date>2023-03-06T14:31:53Z</dc:date>
    <item>
      <title>Trace statement with nested brackets turns following load script into comments</title>
      <link>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045143#M85982</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;This is probably the strangest thing I've seen in 10 years of Qlik script development.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created a subroutine for debugging purposes that outputs the contents of a table using a TRACE statement.&lt;/P&gt;
&lt;P&gt;The subroutine basically iterates over each record in the table, initializes a variable (&lt;EM&gt;ostring&lt;/EM&gt;) and then iterates over each field and concatenates the field's value to &lt;EM&gt;ostring&lt;/EM&gt;.&amp;nbsp; &amp;nbsp;The subroutine surrounds the value of each field with square brackets so that I can visually differentiate the values.&amp;nbsp;&amp;nbsp;After all fields in the record are iterated over, there is a&amp;nbsp; &lt;STRONG&gt;TRACE $(ostring);&lt;/STRONG&gt; statement to output the record .&lt;/P&gt;
&lt;P&gt;Normally the output looks something like &lt;STRONG&gt;[ABC] [123] [Good Day]&lt;/STRONG&gt;. Pretty simple right?&lt;/P&gt;
&lt;P&gt;But here's the weird part: One of my fields had a value that was already surrounded by square brackets so the resulting output was: &lt;STRONG&gt;[ABC][123][[Good Day]]&lt;/STRONG&gt;. The strange thing is, when you have nested square brackets in a TRACE statement, it acts like a "/*" comment header and treats a good chunk of the load script following the TRACE as a comment section.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try it yourself. Add the following statement to your script: &lt;STRONG&gt;TRACE [ABC][123][[Good Day]];&lt;/STRONG&gt; and see what happens.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So is this expected/obvious behavior and I'm just overlooking something, or is this truly strange behavior and possibly a (gasp!) bug?&lt;/P&gt;
&lt;P&gt;-Steve&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 16:33:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045143#M85982</guid>
      <dc:creator>stascher</dc:creator>
      <dc:date>2023-03-03T16:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Trace statement with nested brackets turns following load script into comments</title>
      <link>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045305#M85991</link>
      <description>&lt;P&gt;Curious. And only the final brackets seems to create this behaviour, only when there is an even number of closing brackets the next code is like part of the trace sentence.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2023 08:01:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045305#M85991</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2023-03-04T08:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Trace statement with nested brackets turns following load script into comments</title>
      <link>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045622#M86006</link>
      <description>&lt;P&gt;Yes, after further investigation, I also noticed that as well.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 12:38:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045622#M86006</guid>
      <dc:creator>stascher</dc:creator>
      <dc:date>2023-03-06T12:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Trace statement with nested brackets turns following load script into comments</title>
      <link>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045676#M86010</link>
      <description>&lt;P&gt;Fascinating!&lt;/P&gt;
&lt;P&gt;This works:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;trace ABC]];&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;But this is not working:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;trace [ABC]];&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 14:31:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045676#M86010</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2023-03-06T14:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trace statement with nested brackets turns following load script into comments</title>
      <link>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045806#M86019</link>
      <description>&lt;P&gt;It's really interesting. Never noticed this behaviour.&lt;/P&gt;
&lt;P&gt;Just looked into&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Design/QlikView-Quoteology/ba-p/1476029" target="_blank"&gt;QlikView Quoteology - Qlik Community - 1476029&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Design/Escape-sequences/ba-p/1469770" target="_blank"&gt;Escape sequences - Qlik Community - 1469770&lt;/A&gt;&amp;nbsp;to find hints - and there are, at least in regard to field- and table-names respectively in-load-statements in which such syntax is possible and valide.&lt;/P&gt;
&lt;P&gt;But outside from the load it showed the above mentioned behaviour and not only by a trace-statement else also by creating variables. Beside this the behaviour might be bypassed by wrapping the [...]] with single- or double-quotes.&lt;/P&gt;
&lt;P&gt;I don't know how the script-parser technically worked but I rather don't believe that's a classical bug else that's from the very old days is a not documented feature for any special purpose which wasn't removed - maybe&amp;nbsp;&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6622" target="_blank"&gt;hic&lt;/A&gt;&amp;nbsp;could shed some light.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 16:51:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045806#M86019</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-03-06T16:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Trace statement with nested brackets turns following load script into comments</title>
      <link>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045834#M86021</link>
      <description>&lt;P&gt;Really weird&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2023 18:10:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2045834#M86021</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2023-03-06T18:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trace statement with nested brackets turns following load script into comments</title>
      <link>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2046019#M86026</link>
      <description>&lt;P&gt;The &lt;A href="https://community.qlik.com/t5/Design/Escape-sequences/ba-p/1469770" target="_self"&gt;Escape Sequences&lt;/A&gt; article &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt; linked to actually gives us the explanation. Two similiar square brackets next to each other renders one of them as an escape character for the second one. In other words, &lt;STRONG&gt;]]&lt;/STRONG&gt; is treated as one string formatted bracket: ']'&lt;/P&gt;
&lt;P&gt;So&amp;nbsp; &lt;STRONG&gt;[ABC]] &lt;/STRONG&gt;becomes the string 'ABC&lt;FONT color="#FF0000"&gt;]&lt;FONT color="#000000"&gt;' where the bracket I have marked red is interpreted as a string character and not as a bracket function.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;[ABC]]]&lt;/STRONG&gt; results in the string '&lt;STRONG&gt;ABC]&lt;/STRONG&gt;' and is therefore functional.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 08:17:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2046019#M86026</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2023-03-07T08:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Trace statement with nested brackets turns following load script into comments</title>
      <link>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2046031#M86029</link>
      <description>&lt;P&gt;Great explanation! I had should read the postings more carefully.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 08:23:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2046031#M86029</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2023-03-07T08:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Trace statement with nested brackets turns following load script into comments</title>
      <link>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2046039#M86032</link>
      <description>&lt;P&gt;It's still a bit confusing though. The original example is &lt;STRONG&gt;[ABC][123][[Good Day]]&lt;/STRONG&gt; - so what happens there?&lt;/P&gt;
&lt;P&gt;Why does that not become sort of 'ABC' '123' '[Good Day]'?&lt;/P&gt;
&lt;P&gt;In the post, it says "If the field name contains square brackets, e.g. a field called Name[5], only the right bracket needs to be escaped. ... Such a field can be loaded as [Name[5]]] "&lt;/P&gt;
&lt;P&gt;It's seems likely that it is true to say that only the right bracket &lt;EM&gt;can&lt;/EM&gt; be escaped. So for some reason [[Good Day]] becomes something like the string &lt;STRONG&gt;[Good Day|&lt;/STRONG&gt; (I've replaced the final char with a pipe instead of bracket just to illustrate) and the first bracket never closes. But I don't think I understand why the first double bracket [[ doesn't become one escaped '[' string character. Maybe it's just a rule that &lt;STRONG&gt;[&lt;/STRONG&gt; can't act as an escape char, but &lt;STRONG&gt;]&lt;/STRONG&gt; can.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 08:31:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Trace-statement-with-nested-brackets-turns-following-load-script/m-p/2046039#M86032</guid>
      <dc:creator>henrikalmen</dc:creator>
      <dc:date>2023-03-07T08:31:57Z</dc:date>
    </item>
  </channel>
</rss>

