<?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: JSL code to clear selected data table contents in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11794#M11294</link>
    <description>&lt;P&gt;Nice function Ian! To simplify it further you could avoid treating different data types separately by using Empty(). It works for both Numeric and Character columns.&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;For(c = 1, c &amp;lt;= N Items(selCols), c++, Column(dt, selCols[c])[selRows] = Empty());&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 26 Jun 2018 18:08:12 GMT</pubDate>
    <dc:creator>ms</dc:creator>
    <dc:date>2018-06-26T18:08:12Z</dc:date>
    <item>
      <title>JSL code to clear selected data table contents</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11791#M11291</link>
      <description>&lt;P&gt;I'm trying to do something that I think should be very easy to accomplish, but I can't find the JSL instruction that will let me.&amp;nbsp; Basically, after selecting various columns and rows I want to delete the contents of the selected cells, not the entire column or row.&amp;nbsp; I can do this manually, but can't find the JSL command to do so.&amp;nbsp; Any suggestions would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;E.g.,&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;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt &amp;lt;&amp;lt; Select Rows( [5, 7, 8, 10] );
Column ( "name" ) &amp;lt;&amp;lt; Set Selected ( 1 );
Column ( "sex" ) &amp;lt;&amp;lt; Set Selected ( 1 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now delete the contents of the selected cells.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 18:07:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11791#M11291</guid>
      <dc:creator>terapin</dc:creator>
      <dc:date>2018-06-26T18:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code to clear selected data table contents</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11792#M11292</link>
      <description>&lt;P&gt;Something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-size: 12px; font-family: Courier; color: #032ce4;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);
 
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
 
// Set up a selection of cells
dt &amp;lt;&amp;lt; Select Rows( [5, 7, 8, 10] );
Column (dt, "name" ) &amp;lt;&amp;lt; Set Selected ( 1 );
Column (dt, "sex" ) &amp;lt;&amp;lt; Set Selected ( 1 );
 
// Function to set currently selected cells to '.' or ""
clearSelectedCells =
  Function({dt}, {Default Local},
  selCols = dt &amp;lt;&amp;lt; getSelectedColumns;
  selRows = dt &amp;lt;&amp;lt; getSelectedRows;
  for(c=1, c&amp;lt;=NItems(selCols), c++,
  dType = Column(dt, selCols[c]) &amp;lt;&amp;lt; getDataType;
  if (dType == "Numeric",
  Column(dt, selCols[c])[selRows] = .
  ,
  Column(dt, selCols[c])[selRows] = ""
  );
  );
  );
 
// Use the function
clearSelectedCells(dt);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="font-size: 12px; font-family: Courier;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 18:07:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11792#M11292</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2018-06-26T18:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code to clear selected data table contents</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11793#M11293</link>
      <description>&lt;P&gt;A simple but potentially risky method is to use MainMenu() to invoke the &lt;EM&gt;Delete&lt;/EM&gt; command in the &lt;EM&gt;Edit Menu. &lt;/EM&gt;It is risky because it will delete anything that is selected in the active window. So in a complex script, make sure to keep track of what window that will be on top when the command is run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-family: Courier; color: #942193;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt &amp;lt;&amp;lt; Select Rows([5, 7, 8, 10]);
Column("name") &amp;lt;&amp;lt; Set Selected(1);
Column("height") &amp;lt;&amp;lt; Set Selected(1);
 
 
dt &amp;lt;&amp;lt; Bring Window To Front;
Main Menu("Delete");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="font-family: Courier; color: #032ce4;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #011993;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: #011993;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jun 2018 18:08:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11793#M11293</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2018-06-26T18:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code to clear selected data table contents</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11794#M11294</link>
      <description>&lt;P&gt;Nice function Ian! To simplify it further you could avoid treating different data types separately by using Empty(). It works for both Numeric and Character columns.&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;For(c = 1, c &amp;lt;= N Items(selCols), c++, Column(dt, selCols[c])[selRows] = Empty());&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Jun 2018 18:08:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11794#M11294</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2018-06-26T18:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code to clear selected data table contents</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11795#M11295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks! Fewer characters is good, especially with my typing . . .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 14:37:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11795#M11295</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2015-04-08T14:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code to clear selected data table contents</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11796#M11296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Thanks folks for your suggestions,&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Nice to see several options.&amp;nbsp; I was thinking there should be a typical command I could call as suggested by MS ( Note: actual command is&amp;nbsp; &lt;SPAN style="color: #032ce4; font-family: Courier; font-size: 13px;"&gt;Main Menu&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: Courier; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: Courier; color: #942193;"&gt;"Clear"&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: Courier; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: Courier; color: #011993;"&gt;;, not &lt;SPAN style="color: #032ce4; font-family: Courier; font-size: 13px;"&gt;Main Menu&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: Courier; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;(&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: Courier; color: #942193;"&gt;"Delete"&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: Courier; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #011993; font-size: 13px; font-family: Courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 19:26:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11796#M11296</guid>
      <dc:creator>terapin</dc:creator>
      <dc:date>2015-04-08T19:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: JSL code to clear selected data table contents</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11797#M11297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's a difference between operating system standards here.&amp;nbsp; Windows uses &lt;STRONG&gt;Edit-&amp;gt;Clear&lt;/STRONG&gt; and the Mac uses &lt;STRONG&gt;Edit-&amp;gt;Delete&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, to make a script robust to either you'll need to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;BR /&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;SPAN style="color: #032ce4;"&gt;If&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt;&lt;SPAN style="color: #032ce4;"&gt;Host is&lt;/SPAN&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; Windows &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #032ce4;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;Main Menu&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"Clear"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #011993;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008f00;"&gt;//Windows&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-size: 12px; font-family: Courier; color: #032ce4;"&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;Main Menu&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;(&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #942193;"&gt;"Delete"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;STRONG&gt;)&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008f00;"&gt;//Mac&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-size: 12px; font-family: Courier;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;SPAN style="color: #011993;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 19:58:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-code-to-clear-selected-data-table-contents/m-p/11797#M11297</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2015-04-08T19:58:24Z</dc:date>
    </item>
  </channel>
</rss>

