<?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: Scriptable[] or 'send expects scriptable object' in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46547#M26525</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10002"&gt;@asdf&lt;/a&gt;&amp;nbsp;:&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Attachment (.zip) file is empty - so your data was not provided to test your code and see you error to troubleshoot .&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;In the absence of the actual data you are working with - here lets look at this example .&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Air Traffic.jmp" );

dt &amp;lt;&amp;lt; Select Where(:Airline == "Delta" &amp;amp; :Event == "Arrive"); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; As you can see - you can select rows where two different conditions on two different columns are being met.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; In your case - if the&amp;nbsp;&lt;SPAN&gt;PM#=2 and&amp;nbsp; Logistic#=1 refer to 2 different tables - then you need to join the tables based on common columns for what you are after.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; If its not either - please provide actual sample data .&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Oct 2017 22:21:40 GMT</pubDate>
    <dc:creator>uday_guntupalli</dc:creator>
    <dc:date>2017-10-30T22:21:40Z</dc:date>
    <item>
      <title>Scriptable[] or 'send expects scriptable object'</title>
      <link>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46546#M26524</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I've tried many methods of trying to select specific rows with PM#=2 and&amp;nbsp; Logistic#=1 in my pre-filtered table, but I either get a 'Send expects scriptable object' message, a 'Scriptable[]' and then script termination, or an endless loop.&amp;nbsp; Can someone please help with what is inappropriate with the syntax that I cannot program the row selection?&amp;nbsp; Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;lamstationfile=Pick File("choose file","$Documents" );
dt=Open(lamstationfile,
Import Settings(End Of Field( Tab ),Scan Whole File( 1 ), Column Names Start(7 ),Data Starts( 8),));
dt = Current Data Table();

//find data rows
w=NRow(dt);
dt&amp;lt;&amp;lt;Select Where(:Time=="NUM_DATA_ROWS")&amp;lt;&amp;lt;Label(1);
d=dt&amp;lt;&amp;lt;Get Selected Rows;
Show(d);
dt&amp;lt;&amp;lt;Select Where(Row()&amp;gt;(d-1));
dt2=dt&amp;lt;&amp;lt;Subset( Selected Rows(1), Selected columns only(0));
dt&amp;lt;&amp;lt;Select Where(Row()&amp;gt;(d-1))&amp;lt;&amp;lt;Delete Rows;
// Change first two columns to numeric data
Column(dt,1)&amp;lt;&amp;lt; Data Type (Numeric); Column(dt,1)&amp;lt;&amp;lt;Modeling Type("Continuous");
Column(dt,2)&amp;lt;&amp;lt; Data Type (Numeric); Column(dt,2)&amp;lt;&amp;lt;Modeling Type("Continuous");
 

nw= New Window( "What PM?",&amp;lt;&amp;lt;Modal,&amp;lt;&amp;lt;Bring Window To Front,
V List Box( Text Box( "PM#"), pm_in = Text Edit Box("PM#", &amp;lt;&amp;lt;Justify Text (Center)), Spacer Box(Size(25,25))),
H List Box( Button Box("OK", pm= pm_in &amp;lt;&amp;lt; Get Text();), Button Box("Cancel", nw&amp;lt;&amp;lt;Close Window)));
nw= New Window( "What Logistic?",&amp;lt;&amp;lt;Modal,&amp;lt;&amp;lt;Bring Window To Front,
V List Box( Text Box( "Logistic#"), wafer_in =Text Edit Box("Logistic#"), Spacer Box(Size(25,25))),
H List Box( Button Box("OK", logis= wafer_in &amp;lt;&amp;lt; Get Text();), Button Box("Cancel", nw&amp;lt;&amp;lt;Close Window)));
//take out uneccessary PM data
Show("PM"|| pm);
ColNames = dt &amp;lt;&amp;lt; Get Column Names();
colstrings = char(colnames);
match = regex(colstrings, "PM"|| pm);
//Show(colstrings);
found_list={};
close(dt2,no save);
//how can I have it with 2 dt open?
for (i = 1, i &amp;lt;= nitems(ColNames), i++,
if (contains(ColNames[i], match),
ColNames[i]&amp;lt;&amp;lt;Set Selected(1)
//insertinto(found_list, ColNames[i]);
);
);
Column(dt,1)&amp;lt;&amp;lt;Set Selected(1);
//For found_list&amp;lt;&amp;lt;Set Selected(1);
//Show(found_list);
dt3=dt&amp;lt;&amp;lt;Subset( Selected Rows(0), Selected columns only(1));

Num(logis);
Show(logis);
//Logistics column is the last in the table
clos=NCol(dt3);
Show(clos);
Show( Column( dt3, clos )[2] );
 
//dt3&amp;lt;&amp;lt;Get Rows Where(:Column(clos)==logis);  //Method #1
 
dt3&amp;lt;&amp;lt;Selet Where(:Column( dt3, clos ) == Num( logis ));   //Method#2
 
//For(i=1, i=NRows(dt3), i++,    //Method#3
//If( Column( dt3, clos )[i] == Num( logis ),
// Column( dt3, clos )[i] &amp;lt;&amp;lt; Set Selected( 1 ));  );
 
 
//For Each Row(If( :Column( dt3, clos ) == Num( logis ), :Column( dt3, clos ) &amp;lt;&amp;lt; Set //Selected(1));  //Method#4&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 21:47:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46546#M26524</guid>
      <dc:creator>asdf</dc:creator>
      <dc:date>2017-10-30T21:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Scriptable[] or 'send expects scriptable object'</title>
      <link>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46547#M26525</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10002"&gt;@asdf&lt;/a&gt;&amp;nbsp;:&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Attachment (.zip) file is empty - so your data was not provided to test your code and see you error to troubleshoot .&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;In the absence of the actual data you are working with - here lets look at this example .&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Air Traffic.jmp" );

dt &amp;lt;&amp;lt; Select Where(:Airline == "Delta" &amp;amp; :Event == "Arrive"); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; As you can see - you can select rows where two different conditions on two different columns are being met.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; In your case - if the&amp;nbsp;&lt;SPAN&gt;PM#=2 and&amp;nbsp; Logistic#=1 refer to 2 different tables - then you need to join the tables based on common columns for what you are after.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; If its not either - please provide actual sample data .&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 22:21:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46547#M26525</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2017-10-30T22:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Scriptable[] or 'send expects scriptable object'</title>
      <link>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46552#M26528</link>
      <description>&lt;P&gt;Sorry.&amp;nbsp; The data is now appropriately attached.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 00:10:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46552#M26528</guid>
      <dc:creator>asdf</dc:creator>
      <dc:date>2017-10-31T00:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Scriptable[] or 'send expects scriptable object'</title>
      <link>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46558#M26532</link>
      <description>&lt;P&gt;Here is a script that covers the first issue in your data table, selecting row after finding "NUM_DATA_ROWS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;lamstationfile = Pick File( "choose file", "$Documents" );
dt = Open( lamstationfile, Import Settings( End Of Field( Tab ), 
Scan Whole File( 1 ), Column Names Start( 7 ), Data Starts( 8 ), ) );
dt = Current Data Table();

//find data rows
w = N Row( dt );
dt &amp;lt;&amp;lt; Select Where( :Time == "NUM_DATA_ROWS" ) &amp;lt;&amp;lt; Label( 1 );
d = dt &amp;lt;&amp;lt; Get Selected Rows;
Show( d );
// A matrix is returned from &amp;lt;&amp;lt; Get Selected Rows, so you need to reference d[1]
dt &amp;lt;&amp;lt; Select Where( Row() &amp;gt; (d[1] - 1) );
dt2 = dt &amp;lt;&amp;lt; Subset( Selected Rows( 1 ), Selected columns only( 0 ) );
dt /*&amp;lt;&amp;lt; Select Where( Row() &amp;gt; (d - 1) )*/ &amp;lt;&amp;lt; Delete Rows;
// Change first two columns to numeric data
Column( dt, 1 ) &amp;lt;&amp;lt; Data Type( Numeric );
Column( dt, 1 ) &amp;lt;&amp;lt; Modeling Type( "Continuous" );
Column( dt, 1 ) &amp;lt;&amp;lt; format("hr:m:s");
Column( dt, 2 ) &amp;lt;&amp;lt; Data Type( Numeric );
Column( dt, 2 ) &amp;lt;&amp;lt; Modeling Type( "Continuous" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Concerning your selection of columns and then subsetting, I would suggest that you use the builtin column selection tool, "Columns Viewer" rather than building your own selection tool.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Columns Viewer;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Oct 2017 03:32:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46558#M26532</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-10-31T03:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Scriptable[] or 'send expects scriptable object'</title>
      <link>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46608#M26562</link>
      <description>&lt;P&gt;Sorry, I should have been more clear.&amp;nbsp; The problem I am having is with the end of my code after I've created a third data table dt3.&amp;nbsp; Everything before the last active line of code works fine [getting rows and columns in first data table dt, setting the inputs PM#=2 and Logistic#=1 are fine ].&amp;nbsp; I just cannot select several rows in dt3 where Logistic# =1 .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried several different methods as noted in the code excerpt below, but I either get code terminated with 'Scriptable[]' note or 'Send expects scriptable object' error.&amp;nbsp; I'm not sure where in the below code is preventing it from running appropriately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-jsl"&gt;&lt;CODE class="  language-jsl"&gt;&lt;SPAN class="token comment"&gt;//dt3&amp;lt;&amp;lt;Get Rows Where(:Column(clos)==logis);  //Method #1&lt;/SPAN&gt;
 
dt3&lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt;Selet Where&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;:&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Column&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; dt3&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; clos &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;==&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Num&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; logis &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;   &lt;SPAN class="token comment"&gt;//Method#2&lt;/SPAN&gt;
 
&lt;SPAN class="token comment"&gt;//For(i=1, i=NRows(dt3), i++,    //Method#3&lt;/SPAN&gt;
&lt;SPAN class="token comment"&gt;//If( Column( dt3, clos )[i] == Num( logis ),&lt;/SPAN&gt;
&lt;SPAN class="token comment"&gt;// Column( dt3, clos )[i] &amp;lt;&amp;lt; Set Selected( 1 ));  );&lt;/SPAN&gt;
 
 
&lt;SPAN class="token comment"&gt;//For Each Row(If( :Column( dt3, clos ) == Num( logis ), :Column( dt3, clos ) &amp;lt;&amp;lt; Set //Selected(1));  //Method#4&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 23:39:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46608#M26562</guid>
      <dc:creator>asdf</dc:creator>
      <dc:date>2017-10-31T23:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Scriptable[] or 'send expects scriptable object'</title>
      <link>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46609#M26563</link>
      <description>dt3 &amp;lt;&amp;lt;Select Where(:Column( dt3, clos ) == Num( logis )); // There is a typo to start with</description>
      <pubDate>Tue, 31 Oct 2017 23:41:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46609#M26563</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2017-10-31T23:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Scriptable[] or 'send expects scriptable object'</title>
      <link>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46610#M26564</link>
      <description>&lt;P&gt;I&amp;nbsp;thought that&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&amp;nbsp;code should work, however in 13.2.1 it would not(strange).&amp;nbsp; However, using As Column() instead of Column() allowed your specific code to work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt3 = Open( "$SAMPLE_DATA/Big Class.jmp" );
logis = "55";
clos = "Height";
dt3 &amp;lt;&amp;lt; Select Where( As Column( dt3, clos ) == Num( logis ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Nov 2017 03:15:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46610#M26564</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-11-01T03:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Scriptable[] or 'send expects scriptable object'</title>
      <link>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46637#M26576</link>
      <description>Thank you for your response. I think that typo only happened when I was transferring the code to the Online Discussion. There wasn't a typo on my computer, otherwise I would have gotten a different error. Also, Method#1, #3, and #4 didn't work for me either. Not sure why.&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt; wrote:&lt;BR /&gt;dt3 &amp;lt;&amp;lt;Select Where(:Column( dt3, clos ) == Num( logis ));&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 01 Nov 2017 14:55:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46637#M26576</guid>
      <dc:creator>asdf</dc:creator>
      <dc:date>2017-11-01T14:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Scriptable[] or 'send expects scriptable object'</title>
      <link>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46639#M26577</link>
      <description>The data that you attached is a file , I am unable to open .&lt;BR /&gt;Can you just provide a small subset of the table you are trying to work with ?&lt;BR /&gt;One reason I can think of as to why your row selection doesn't work .&lt;BR /&gt;&lt;BR /&gt;Besides providing sample data set , can you try this ?&lt;BR /&gt;dt = Current Data Table();&lt;BR /&gt;And then run your selection where dt is the data table you are working with .&lt;BR /&gt;If JMP doesn't recognize or has lost the reference of the data table , then irrespective of your approach - the row selection operation will not work .</description>
      <pubDate>Wed, 01 Nov 2017 15:17:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Scriptable-or-send-expects-scriptable-object/m-p/46639#M26577</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2017-11-01T15:17:35Z</dc:date>
    </item>
  </channel>
</rss>

