<?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: How do I resolve the &amp;amp;quot;Subscript Range in access or evaluation&amp;amp;quot; in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743822#M92352</link>
    <description>&lt;P&gt;Don't I need to define "i"..I get Name unresolved for i...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PriorLovebird31_0-1712157756408.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63027i82DB3A2797D3F7C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PriorLovebird31_0-1712157756408.png" alt="PriorLovebird31_0-1712157756408.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 15:22:44 GMT</pubDate>
    <dc:creator>PriorLovebird31</dc:creator>
    <dc:date>2024-04-03T15:22:44Z</dc:date>
    <item>
      <title>How do I resolve the &amp;quot;Subscript Range in access or evaluation&amp;quot;</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743765#M92348</link>
      <description>&lt;DIV&gt;I get error&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Subscript Range in access or evaluation of 'openDTs[ /*###*/1]' , openDTs[/*###*/1]"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but it works on some folder and I don't get the error...Below is my JSL&lt;/P&gt;
&lt;P&gt;JSL "&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dir = Set Default Directory("path");
Print(dir);
files = Files In Directory("path");
For(i = 1, i &amp;lt;= N Items(files), i++,
	If(Ends With(files[i], ".txt"),
		Open(
			files[i],
			Import Settings(
				End Of Line(CRLF, CR, LF),
				End Of Field(Comma),
				Strip Quotes(0),
				Use Apostrophe as Quotation Mark(0),
				Scan Whole File(1),
				Labels(0),
				Column Names Start(1),
				Data Starts(1),
				Lines To Read(All),
				Year Rule("10-90")
			)
		)
	)
);
 
openDTs = List();
For(i = 1, i &amp;lt;= N Table(), i++,
	Insert Into(openDTs, Data Table(i))
);
 
For(i = 1, i &amp;lt;= N Items(openDTs), i++,
	openDTs[i] &amp;lt;&amp;lt; New Column("Location", Character, Nominal, Set Each Value(dir));
	openDTs[i] &amp;lt;&amp;lt; New Column("FileName",
		Character,
		Nominal,
		Set Each Value(openDTs[i] &amp;lt;&amp;lt; Get path)
	);
);
 
openDTs1 = openDTs[1];
Remove From(openDTs, 1);
Joined_new = openDTs1 &amp;lt;&amp;lt; concatenate(openDTs, output table name("Joined_new"));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;DIV&gt;"&lt;/DIV&gt;</description>
      <pubDate>Wed, 03 Apr 2024 15:03:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743765#M92348</guid>
      <dc:creator>PriorLovebird31</dc:creator>
      <dc:date>2024-04-03T15:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I resolve the &amp;quot;Subscript Range in access or evaluation&amp;quot;</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743766#M92349</link>
      <description>&lt;P&gt;Could it be that some of your folders have no files which could be turned into data table and openDTs is empty list?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:&lt;/P&gt;
&lt;P&gt;You can add check and stop if no tables have been opened. I made slight modifications to your script but the idea should still be the same with the exception of final checks after the the loop (requires JMP16+) and it assumes you want to only use tables which are found from your directory&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dir = Set Default Directory("path");
files = Files In Directory("path");

dts = {};

For Each({filepath}, files,
	If(Ends With(filepath, ".txt"),
		dt = Open(
			filepath,
			Import Settings(
				End Of Line(CRLF, CR, LF),
				End Of Field(Comma),
				Strip Quotes(0),
				Use Apostrophe as Quotation Mark(0),
				Scan Whole File(1),
				Labels(0),
				Column Names Start(1),
				Data Starts(1),
				Lines To Read(All),
				Year Rule("10-90")
			)
		);
		dt &amp;lt;&amp;lt; New Column("Location", Character, Nominal, Set Each Value(dir));
		dt &amp;lt;&amp;lt; New Column("FileName", Character, Nominal, Set Each Value(dt &amp;lt;&amp;lt; Get path));
		
		Insert Into(dts, dt);
	);
);

If(N Items(dts) == 0,
	stop(); // stop here as no tables have been created
, N Items(dts) == 1,
	dt_final = dts[1]; // only one table
, // else - more than one table
	dt_first = Remove From(dts, 1)[1]; // Remove From returns a list -&amp;gt; take first index
	dt_final = openDTs1 &amp;lt;&amp;lt; concatenate(dts, output table name("Joined_new"));
);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Edit 2: Fixed Open(files[i] to Open(filepath&lt;/P&gt;
&lt;P&gt;Edit 3: Fixed openDTS1 to dt_first&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 16:25:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743766#M92349</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-04-03T16:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I resolve the &amp;quot;Subscript Range in access or evaluation&amp;quot;</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743822#M92352</link>
      <description>&lt;P&gt;Don't I need to define "i"..I get Name unresolved for i...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PriorLovebird31_0-1712157756408.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/63027i82DB3A2797D3F7C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PriorLovebird31_0-1712157756408.png" alt="PriorLovebird31_0-1712157756408.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 15:22:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743822#M92352</guid>
      <dc:creator>PriorLovebird31</dc:creator>
      <dc:date>2024-04-03T15:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I resolve the &amp;quot;Subscript Range in access or evaluation&amp;quot;</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743843#M92354</link>
      <description>&lt;P&gt;Type on my code, replace files[i] with&lt;/P&gt;
&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;filepath&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Apr 2024 15:39:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743843#M92354</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-04-03T15:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I resolve the &amp;quot;Subscript Range in access or evaluation&amp;quot;</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743901#M92361</link>
      <description>&lt;P&gt;Also the OpenDTs1 called here should be "dts"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;dt_final = openDTs1 &amp;lt;&amp;lt; concatenate(dts, output table name("Joined_new"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 16:17:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743901#M92361</guid>
      <dc:creator>PriorLovebird31</dc:creator>
      <dc:date>2024-04-03T16:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I resolve the &amp;quot;Subscript Range in access or evaluation&amp;quot;</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743916#M92363</link>
      <description>&lt;P&gt;It should be&lt;/P&gt;
&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;dt_first &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Apr 2024 16:25:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-resolve-the-amp-quot-Subscript-Range-in-access-or/m-p/743916#M92363</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-04-03T16:25:03Z</dc:date>
    </item>
  </channel>
</rss>

