<?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: JMP crashing from some combination of nested If(for(if())) loops, &amp;quot;string&amp;quot; || i for column reference, eval() -&amp;gt; expr(), and concat() + char() in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JMP-crashing-from-some-combination-of-nested-If-for-if-loops/m-p/694522#M87959</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;Good point! So in my fatigue last night, I forgot to mention in my original question that I actually turned to the Eval(Eval Expr(Expr())) construct specifically because the simple Char(i) version didn't work, and was my first source of a crash in the software.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I found the issue. I was treating the second condition of a for loop to be "until", whereas its a "while" condition. So rather than an inequality, I had an equality (i = reps), so my guess is that it was just iterating until &lt;SPAN&gt;∞, because for some reason it stopped on one test, and i was 137, and reps should be at max 3.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've learned something today.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your help!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 04 Nov 2023 18:13:07 GMT</pubDate>
    <dc:creator>ehchandlerjr</dc:creator>
    <dc:date>2023-11-04T18:13:07Z</dc:date>
    <item>
      <title>JMP crashing from some combination of nested If(for(if())) loops, "string" || i for column reference, eval() -&gt; expr(), and concat() + char()</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-crashing-from-some-combination-of-nested-If-for-if-loops/m-p/694470#M87955</link>
      <description>&lt;P&gt;I feel like this is a simple question, but I can't for the life of me get this to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The context is I have an XML extractor that frustratingly has to deal with n-tuples of mostly (aside from one row) redundant entries a couple levels into the structure. I'm trying to find those "duplicate" entries, and check if they are indeed duplicates before I import them into my larger table. I've got the checking the number of repeats down, but I'm having a horrible time getting my nested for/if loop to work. In fact, the loop consistently crashes the whole software if I have an Eval( Eval Expr(....Expr())) nested in the wrong place. I'm not sure why this is, and I'm wondering if I am just misunderstanding how to use that construction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suppose it may also be an issue with using char() and concatenate90 nested inside one another, though again, I'm not sure why that would be. The current code I have below crashes the software.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;colnames = dt &amp;lt;&amp;lt; Get Column Names( String );
show(colnames);
reps = 0;
show(reps);
For( i = 1, i &amp;lt;= N Items( colnames), i++,
	reps = Sum( reps, Contains(colnames[i], "Data - Common Counting Time")); show(reps)
);

check = 0;
//Repeats that split columns
colnamecount = "Scan Append Number_4"; //Using a file that only has three of these columns, so show(colnamecount) = *_4 means its not going past that first if statment
If( reps&amp;gt; 1,
	For( i = 2, i = reps, i++,
		Eval(Eval Expr(colnamecount = Concat("Scan Append Number_", Char(Expr(i))))); //This is the issue
		If(dt:{"Scan Append Number_1"}[1] == Column( colnamecount )[1],
			check = check + 1,
			check = check + 12
		)
	)
);
show(check);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The code doesn't work regardless, but until I can get that If statment comparing the column with the concatenated name to the first of the n-tupled columns, it doesn't matter, and first I need to get the concatenation to work and not crash jsl.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any thoughts? Am I just being dumb with syntax?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 04:14:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-crashing-from-some-combination-of-nested-If-for-if-loops/m-p/694470#M87955</guid>
      <dc:creator>ehchandlerjr</dc:creator>
      <dc:date>2023-11-04T04:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: JMP crashing from some combination of nested If(for(if())) loops, "string" || i for column reference, eval() -&gt; expr(), and concat() + char()</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-crashing-from-some-combination-of-nested-If-for-if-loops/m-p/694489#M87958</link>
      <description>&lt;P&gt;For the concatenation you don't need the Eval(Eval Epr(Expr())), you can reduce it to&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;for(i=2,i&amp;lt;10,i++,
colname=Concat("Scan Append Number_", Char(i));
Print(colname));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Nov 2023 10:24:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-crashing-from-some-combination-of-nested-If-for-if-loops/m-p/694489#M87958</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-11-04T10:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: JMP crashing from some combination of nested If(for(if())) loops, "string" || i for column reference, eval() -&gt; expr(), and concat() + char()</title>
      <link>https://community.jmp.com/t5/Discussions/JMP-crashing-from-some-combination-of-nested-If-for-if-loops/m-p/694522#M87959</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;Good point! So in my fatigue last night, I forgot to mention in my original question that I actually turned to the Eval(Eval Expr(Expr())) construct specifically because the simple Char(i) version didn't work, and was my first source of a crash in the software.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I found the issue. I was treating the second condition of a for loop to be "until", whereas its a "while" condition. So rather than an inequality, I had an equality (i = reps), so my guess is that it was just iterating until &lt;SPAN&gt;∞, because for some reason it stopped on one test, and i was 137, and reps should be at max 3.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've learned something today.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 18:13:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JMP-crashing-from-some-combination-of-nested-If-for-if-loops/m-p/694522#M87959</guid>
      <dc:creator>ehchandlerjr</dc:creator>
      <dc:date>2023-11-04T18:13:07Z</dc:date>
    </item>
  </channel>
</rss>

