<?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 Endless do loop: &amp;quot;do while ($(a) &amp;lt;= 3) &amp;quot; in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Endless-do-loop-quot-do-while-a-lt-3-quot/m-p/229733#M81621</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;the help function says the following about the do .. loop&lt;/P&gt;&lt;P&gt;"each condition is interpreted only the first time it is encountered but it is evaluated for every time time it [is] encountered in the loop."&lt;/P&gt;&lt;P&gt;You have used the $() expansion so that when the script encounters this line it interpretes it as&lt;/P&gt;&lt;P&gt;"do while(1&amp;lt;=3)"&lt;/P&gt;&lt;P&gt;it will then evaluate this same line again and again, hence your endless loop.&lt;/P&gt;&lt;P&gt;When you don't use $() expansions the script interpretes&lt;/P&gt;&lt;P&gt;"do wile (a&amp;lt;=3)"&lt;/P&gt;&lt;P&gt;this is succesfully evaluated at each loop.&lt;/P&gt;&lt;P&gt;I think that explains what you are seeing - use the debug fucbntion in the script editor to get a close look at what is happening as your script is stepped through.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Apr 2011 13:47:04 GMT</pubDate>
    <dc:creator>pat_agen</dc:creator>
    <dc:date>2011-04-26T13:47:04Z</dc:date>
    <item>
      <title>Endless do loop: "do while ($(a) &lt;= 3) "</title>
      <link>https://community.qlik.com/t5/QlikView/Endless-do-loop-quot-do-while-a-lt-3-quot/m-p/229732#M81620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;can anyone explain me what happens when I use "do while ($(a) &amp;lt;= 3) " ?&lt;/P&gt;&lt;P&gt;When i use "do while (&lt;STRONG&gt;$(a)&lt;/STRONG&gt; &amp;lt;= 3)" I get an endless loop.&lt;/P&gt;&lt;P&gt;With "do while (&lt;STRONG&gt;a&lt;/STRONG&gt; &amp;lt;= 3) " it works right.&lt;/P&gt;&lt;P&gt;What´s the difference?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example see below.&lt;/P&gt;&lt;P&gt;Table:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; Test1, Test2&lt;BR /&gt; 1, 88&lt;BR /&gt; 2, 77&lt;BR /&gt; 3, 66&lt;BR /&gt; 4, 55&lt;BR /&gt; 9, 99&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;LET a = 1;&lt;BR /&gt;do while ($(a) &amp;lt;= 3)&lt;BR /&gt;LOAD&lt;BR /&gt;Test1,&lt;BR /&gt;Test2 AS NTEST2&lt;BR /&gt;RESIDENT Table;&lt;BR /&gt;LET a = a + 1;&lt;BR /&gt;loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2011 13:31:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Endless-do-loop-quot-do-while-a-lt-3-quot/m-p/229732#M81620</guid>
      <dc:creator />
      <dc:date>2011-04-26T13:31:50Z</dc:date>
    </item>
    <item>
      <title>Endless do loop: "do while ($(a) &lt;= 3) "</title>
      <link>https://community.qlik.com/t5/QlikView/Endless-do-loop-quot-do-while-a-lt-3-quot/m-p/229733#M81621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;the help function says the following about the do .. loop&lt;/P&gt;&lt;P&gt;"each condition is interpreted only the first time it is encountered but it is evaluated for every time time it [is] encountered in the loop."&lt;/P&gt;&lt;P&gt;You have used the $() expansion so that when the script encounters this line it interpretes it as&lt;/P&gt;&lt;P&gt;"do while(1&amp;lt;=3)"&lt;/P&gt;&lt;P&gt;it will then evaluate this same line again and again, hence your endless loop.&lt;/P&gt;&lt;P&gt;When you don't use $() expansions the script interpretes&lt;/P&gt;&lt;P&gt;"do wile (a&amp;lt;=3)"&lt;/P&gt;&lt;P&gt;this is succesfully evaluated at each loop.&lt;/P&gt;&lt;P&gt;I think that explains what you are seeing - use the debug fucbntion in the script editor to get a close look at what is happening as your script is stepped through.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2011 13:47:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Endless-do-loop-quot-do-while-a-lt-3-quot/m-p/229733#M81621</guid>
      <dc:creator>pat_agen</dc:creator>
      <dc:date>2011-04-26T13:47:04Z</dc:date>
    </item>
  </channel>
</rss>

