<?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: pp[k]&amp;lt;&amp;lt;Set Selected results in error Send Expects Scriptable Object{1} in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/47410#M27050</link>
    <description>&lt;P&gt;If you add an As Column() to the column reference it should work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

pp = dt &amp;lt;&amp;lt; Get Column Names();
Show( pp );
ncols = N Items( pp );
For( k = 1, k &amp;lt;= ncols, k++,
	As Column( pp[k] ) &amp;lt;&amp;lt; Set Selected( 1 )
);
dt &amp;lt;&amp;lt; Compress Selected Columns();
dt &amp;lt;&amp;lt; Clear Column Selection;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 20 Nov 2017 17:58:06 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2017-11-20T17:58:06Z</dc:date>
    <item>
      <title>pp[k]&lt;&lt;Set Selected results in error Send Expects Scriptable Object{1}</title>
      <link>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/36410#M27047</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;I have a similar problem having recently upgraded from JMP 10 to JMP 13. The&amp;nbsp;&lt;/P&gt;
&lt;P&gt;following is deployed multiple times in a script to&amp;nbsp;compress selected columns.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;pp=dt&amp;lt;&amp;lt;Get Column Names(); ncols = N Items(pp); for(k=1,k&amp;lt;=ncols,k++, pp[k]&amp;lt;&amp;lt;Set Selected(1););
dt &amp;lt;&amp;lt; Compress Selected Columns();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This works fine in JMP 10 but with&amp;nbsp;JMP 13 and I am getting the following error:&lt;/P&gt;
&lt;PRE&gt;Send Expects Scriptable Object{1} in access or evaluation of 'Send' , pp[k] &amp;lt;&amp;lt;  /*###*/Set Selected( 1 ) /*###*/&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I can see from the above I need to separate this into two steps, but can't quite work out the syntax - are you able to help please? Many thanks&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 17:56:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/36410#M27047</guid>
      <dc:creator>rijking</dc:creator>
      <dc:date>2017-11-20T17:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: pp[k]&lt;&lt;Set Selected results in error Send Expects Scriptable Object{1}</title>
      <link>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/36424#M27048</link>
      <description>&lt;P&gt;Your script looks OK in JMP 10,11,12,13, I think something else has changed. Maybe add show(pp); and check the log to see what's going on. &amp;nbsp;pp[k] is a column (all 5 times) when I run it with Big Class.jmp for the dt.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 17:57:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/36424#M27048</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-11-20T17:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: pp[k]&lt;&lt;Set Selected results in error Send Expects Scriptable Object{1}</title>
      <link>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/47401#M27049</link>
      <description>&lt;P&gt;Having added show(pp); the log does indeed show the column names are returned, but the columns are still not being selected - please see the full log below. Any ideas? Many thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;//:*/
dt=current data table();

pp=dt&amp;lt;&amp;lt;Get Column Names(); 
show (pp);
ncols = N Items(pp); for(k=1, k&amp;lt;=ncols, k++, pp[k] &amp;lt;&amp;lt; Set Selected(1));
dt &amp;lt;&amp;lt; Compress Selected Columns();
dt &amp;lt;&amp;lt; Clear Column Selection;
/*:

pp = {id, yr, rgC, rtC, ptC, cmdC, qtC, TdeQ, NetW, TdeV};
Send Expects Scriptable Object{1} in access or evaluation of 'Send' , pp[k] &amp;lt;&amp;lt;  /*###*/Set Selected( 1 ) /*###*/

In the following script, error marked by /*###*/
dt = Current Data Table();
pp = dt &amp;lt;&amp;lt; Get Column Names();
Show( pp );
ncols = N Items( pp );
For( k = 1, k &amp;lt;= ncols, k++,
	pp[k] &amp;lt;&amp;lt;  /*###*/Set Selected( 1 ) /*###*/
);
dt &amp;lt;&amp;lt; Compress Selected Columns();
dt &amp;lt;&amp;lt; Clear Column Selection;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Nov 2017 17:57:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/47401#M27049</guid>
      <dc:creator>rijking</dc:creator>
      <dc:date>2017-11-20T17:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: pp[k]&lt;&lt;Set Selected results in error Send Expects Scriptable Object{1}</title>
      <link>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/47410#M27050</link>
      <description>&lt;P&gt;If you add an As Column() to the column reference it should work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

pp = dt &amp;lt;&amp;lt; Get Column Names();
Show( pp );
ncols = N Items( pp );
For( k = 1, k &amp;lt;= ncols, k++,
	As Column( pp[k] ) &amp;lt;&amp;lt; Set Selected( 1 )
);
dt &amp;lt;&amp;lt; Compress Selected Columns();
dt &amp;lt;&amp;lt; Clear Column Selection;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Nov 2017 17:58:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/47410#M27050</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-11-20T17:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: pp[k]&lt;&lt;Set Selected results in error Send Expects Scriptable Object{1}</title>
      <link>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/47418#M27051</link>
      <description>&lt;P&gt;Perfect - many thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 17:58:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/47418#M27051</guid>
      <dc:creator>rijking</dc:creator>
      <dc:date>2017-11-20T17:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: pp[k]&lt;&lt;Set Selected results in error Send Expects Scriptable Object{1}</title>
      <link>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/47423#M27052</link>
      <description>&lt;P&gt;Jim has the answer. Here's why:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;height=7;
dt=open("$sample_data/big class.jmp");
pp=dt&amp;lt;&amp;lt;getcolumnnames();
ncols=nitems(pp);
for(k=1,k&amp;lt;=ncols,k++,/*ascolumn*/(pp[k])&amp;lt;&amp;lt;setselected(1));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;there is a variable in the JMP global namespace with the same name as one of the table's columns. Using &lt;EM&gt;ascolumn&amp;nbsp;&lt;/EM&gt;tells JMP to resolve the name with the current data table. You can also specify the data table in &lt;EM&gt;&lt;STRONG&gt;ascolumn( dt, pp[k] )&lt;/STRONG&gt;&lt;/EM&gt; (highly recommended if you might have more than one table open!)&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 17:58:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/pp-k-lt-lt-Set-Selected-results-in-error-Send-Expects-Scriptable/m-p/47423#M27052</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-11-20T17:58:45Z</dc:date>
    </item>
  </channel>
</rss>

