<?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: Copying scripts from one data table to another in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Copying-scripts-from-one-data-table-to-another/m-p/336468#M58379</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4536"&gt;@David_Burnham&lt;/a&gt;&amp;nbsp;'s script for getting all scripts from a data table seemed to be missing a [i] on line 9:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt2 = new table("little class");

lstScriptNames = dt &amp;lt;&amp;lt; Get Table Script Names();

For (i=1,i&amp;lt;=NItems(lstScriptNames),i++,

    scriptName = lstScriptNames[i];

    scriptDef = dt &amp;lt;&amp;lt; get table variable(scriptName);

    Eval(Parse(Eval Insert( "\[

          dt2 &amp;lt;&amp;lt; New Script( "^scriptName^", ^scriptDef^ )

    ]\")));

)&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 23 Nov 2020 11:26:45 GMT</pubDate>
    <dc:creator>Phil_Kay</dc:creator>
    <dc:date>2020-11-23T11:26:45Z</dc:date>
    <item>
      <title>Copying scripts from one data table to another</title>
      <link>https://community.jmp.com/t5/Discussions/Copying-scripts-from-one-data-table-to-another/m-p/3907#M3907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to be able to take scripts stored in one table (A) and use them in another table (B). How can I do this? I'll need to be able to code this in JSL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively, how could I add a script that's stored on my computer (a JSL file) to a data table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is similar to another user's question that was answered about adding a script from a graph to a table. Unfortunately, I don't think I can use the Get Script command in my situation because I don't want the script that made the table, I want a script stored in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;Katie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Oct 2011 21:00:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Copying-scripts-from-one-data-table-to-another/m-p/3907#M3907</guid>
      <dc:creator>katief</dc:creator>
      <dc:date>2011-10-21T21:00:53Z</dc:date>
    </item>
    <item>
      <title>Copying scripts from one data table to another</title>
      <link>https://community.jmp.com/t5/Discussions/Copying-scripts-from-one-data-table-to-another/m-p/3908#M3908</link>
      <description>&lt;P&gt;If you want to copy a specific script you can use the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scriptName = "Oneway";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scriptDef = dt &amp;lt;&amp;lt; get table variable(scriptName);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt2 = new table("little class");

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Eval(Parse(Eval Insert( "\[

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt2 &amp;lt;&amp;lt; New Script( "^scriptName^", ^scriptDef^ )

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]\")));

If you want to copy all of the scripts then you can do this:

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = new table("little class");
lstScriptNames = dt &amp;lt;&amp;lt; Get Table Script Names;
For (i=1,i&amp;lt;=NItems(lstScriptNames),i++,
&amp;nbsp;&amp;nbsp;&amp;nbsp; scriptName = lstScriptNames;
&amp;nbsp;&amp;nbsp;&amp;nbsp; scriptDef = dt &amp;lt;&amp;lt; get table variable(scriptName);
&amp;nbsp;&amp;nbsp;&amp;nbsp; Eval(Parse(Eval Insert( "\[
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dt2 &amp;lt;&amp;lt; New Script( "^scriptName^", ^scriptDef^ )
&amp;nbsp;&amp;nbsp;&amp;nbsp; ]\")));
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;-Dave&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 13:38:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Copying-scripts-from-one-data-table-to-another/m-p/3908#M3908</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2020-11-23T13:38:07Z</dc:date>
    </item>
    <item>
      <title>Copying scripts from one data table to another</title>
      <link>https://community.jmp.com/t5/Discussions/Copying-scripts-from-one-data-table-to-another/m-p/3909#M3909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank you very much!&amp;nbsp; This worked. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think a nice feature to add to JMP would be to allow scripts to be added to JMP tables as files or references- eliminate the need for the eval statement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 13:48:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Copying-scripts-from-one-data-table-to-another/m-p/3909#M3909</guid>
      <dc:creator>katief</dc:creator>
      <dc:date>2011-10-27T13:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Copying scripts from one data table to another</title>
      <link>https://community.jmp.com/t5/Discussions/Copying-scripts-from-one-data-table-to-another/m-p/336468#M58379</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4536"&gt;@David_Burnham&lt;/a&gt;&amp;nbsp;'s script for getting all scripts from a data table seemed to be missing a [i] on line 9:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt2 = new table("little class");

lstScriptNames = dt &amp;lt;&amp;lt; Get Table Script Names();

For (i=1,i&amp;lt;=NItems(lstScriptNames),i++,

    scriptName = lstScriptNames[i];

    scriptDef = dt &amp;lt;&amp;lt; get table variable(scriptName);

    Eval(Parse(Eval Insert( "\[

          dt2 &amp;lt;&amp;lt; New Script( "^scriptName^", ^scriptDef^ )

    ]\")));

)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Nov 2020 11:26:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Copying-scripts-from-one-data-table-to-another/m-p/336468#M58379</guid>
      <dc:creator>Phil_Kay</dc:creator>
      <dc:date>2020-11-23T11:26:45Z</dc:date>
    </item>
  </channel>
</rss>

