<?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: Table Scripts and the Parent Data Table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219920#M44011</link>
    <description>I thought about that, and I may give it a try, but I've decided to just go with David's suggestion and run the scripts from the data table so the Current Table will be the one I want. If I run the script from the editor, I'll just have to be more careful. Question, when writing a script to create table scripts, can comments be included in the table scripts?</description>
    <pubDate>Fri, 02 Aug 2019 21:06:49 GMT</pubDate>
    <dc:creator>MarkDayton</dc:creator>
    <dc:date>2019-08-02T21:06:49Z</dc:date>
    <item>
      <title>Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219675#M43955</link>
      <description>&lt;P&gt;I have a set of scripts that I copy to new data tables. To make sure that when I run the table script it acts on the data table it belongs to I have to edit all of the scripts to point to the right data table (dt = Data Table("this one")). Is there a generic way to reference the parent data table, similar to dt = Current Data Table(), but more like&amp;nbsp;dt = Parent Data Table()?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table script.jpg" style="width: 620px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18543iEC90338AD573645B/image-size/large?v=v2&amp;amp;px=999" role="button" title="table script.jpg" alt="table script.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 13:12:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219675#M43955</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-08-02T13:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219743#M43959</link>
      <description>&lt;P&gt;At the point when you run the table script, the table that it is associated with is the current data table so you should be able to use dt = CurrentDataTable().&lt;/P&gt;</description>
      <pubDate>Thu, 01 Aug 2019 15:58:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219743#M43959</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2019-08-01T15:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219773#M43969</link>
      <description>&lt;P&gt;If the script is open for editing, running the script from the editor will grab whichever data table is current using dt = Current Data Table(). The only way to guarantee that the script will point at the right table is by being explicit about the table the script should act on (which is what JMP teaches in the Intro to Scripting class as a best practice), so I'm looking for a way to do that generically so I don't have to constantly update the scripts everytime the data table name changes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the attached photo, the table script belongs to Data Table("this one") and&amp;nbsp;Data Table("that one") is the Current Data Table(). If "&lt;SPAN&gt;when you run the table script, the table that it is associated with is the current data table" then the result of the scipt should be "this one" not "that one"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table script_2.jpg" style="width: 748px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/18544iCCDC917EFD908E28/image-size/large?v=v2&amp;amp;px=999" role="button" title="table script_2.jpg" alt="table script_2.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:29:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219773#M43969</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-08-02T18:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219815#M43984</link>
      <description>&lt;P&gt;You should be able to create an "OnOpen" table script that when you open the table, it creates a globle variable that contains the current data table that you are working on.&amp;nbsp; Then in the subsequent scripts, you reference that global variable.&amp;nbsp; Just moving from one table to another would not change that global variable.&amp;nbsp; It would only change when another one of your taqbles that has an "OnOpen" table script that changes the global variable is opened.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 06:34:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219815#M43984</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-08-02T06:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219819#M43987</link>
      <description>&lt;P&gt;OK I asumed you were just running it as a table script using the green triangle.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 09:21:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219819#M43987</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2019-08-02T09:21:22Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219878#M43998</link>
      <description>&lt;P&gt;Thanks Jim. I could probably also handle it with a table variable. Can those be hidden? I already have quite a few, and I'd like to limit them.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:08:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219878#M43998</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-08-02T18:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219879#M43999</link>
      <description>&lt;P&gt;not hidden, but you can group them, which takes all of the grouped scripts and places them in a expandable single label&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:12:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219879#M43999</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-08-02T18:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219880#M44000</link>
      <description>Table variables don't group</description>
      <pubDate>Fri, 02 Aug 2019 18:13:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219880#M44000</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-08-02T18:13:38Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219881#M44001</link>
      <description>&lt;P&gt;Just make it a table script that sets a global variable value&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:15:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219881#M44001</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-08-02T18:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219882#M44002</link>
      <description>Thanks David, appreciate the help.</description>
      <pubDate>Fri, 02 Aug 2019 18:15:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219882#M44002</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-08-02T18:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219883#M44003</link>
      <description>Not sure the Global namespace is the place for this in my workflow. I always have multiple tables open at anyone time, hence wanting to make sure that the scripts always work on the right data (but thanks for the heads up on scripting an OnOpen event, didn't know JMP did that). I could just use Current Data Table and always run from the green triangle as David suggested, but I prefer to be explicit in all references when possible. I was hoping that there was a way to do this, but I guess the connection is only one way. Data Tables know what table scripts they have, but table scripts don't know what table they belong to.</description>
      <pubDate>Fri, 02 Aug 2019 18:25:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219883#M44003</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-08-02T18:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219884#M44004</link>
      <description>&lt;P&gt;There is another, more complex way to approach this.&amp;nbsp; Rather than doing a copy/paste for your table scripts, you could write a script that adds the various table scripts to the new table, and within that script, it could generate the code for each of the scripts that would point to the data table the scripts are in.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 18:31:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219884#M44004</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2019-08-02T18:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219920#M44011</link>
      <description>I thought about that, and I may give it a try, but I've decided to just go with David's suggestion and run the scripts from the data table so the Current Table will be the one I want. If I run the script from the editor, I'll just have to be more careful. Question, when writing a script to create table scripts, can comments be included in the table scripts?</description>
      <pubDate>Fri, 02 Aug 2019 21:06:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219920#M44011</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-08-02T21:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Table Scripts and the Parent Data Table</title>
      <link>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219971#M44018</link>
      <description>In answer to my own question no, comments are not included when using a script to add a script to a data table, the comments are stripped out just like they are when you copy scripts from one table to another (why anyone would think this was a desirable default behavior is beyond me, if I take the time to add comments to a script why would I want to throw them away anytime I go to use that script somewhere else).</description>
      <pubDate>Sat, 03 Aug 2019 19:32:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-Scripts-and-the-Parent-Data-Table/m-p/219971#M44018</guid>
      <dc:creator>MarkDayton</dc:creator>
      <dc:date>2019-08-03T19:32:17Z</dc:date>
    </item>
  </channel>
</rss>

