<?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: How to get script from a plot and save to the data table in JSL script? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-get-script-from-a-plot-and-save-to-the-data-table-in-JSL/m-p/510501#M73789</link>
    <description>&lt;P&gt;Thank you! This is very helpful!&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jun 2022 19:32:14 GMT</pubDate>
    <dc:creator>CurseOfLizard13</dc:creator>
    <dc:date>2022-06-15T19:32:14Z</dc:date>
    <item>
      <title>How to get script from a plot and save to the data table in JSL script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-script-from-a-plot-and-save-to-the-data-table-in-JSL/m-p/510490#M73782</link>
      <description>&lt;P&gt;I am trying to extract the script from a plot and save it to the data table for future use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my script for the "Analgesics" table from the "Sample Data Library", which doesn't work as I hoped.&lt;/P&gt;&lt;P&gt;The "print(dtp_script)" line shows the correct script.&lt;/P&gt;&lt;P&gt;However, the actual "plot_dt1" script saved in the data table contains only the "dtp_script" variable name, instead of the actual script. How do I save the actual script in the data table? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table ();
dtplot = dt &amp;lt;&amp;lt; Fit Group( Oneway( Y( :pain ), X( :gender ) ),
	Oneway( Y( :pain ), X( :drug ) ),
	&amp;lt;&amp;lt;{Arrange in Rows( 2 )} );
dtp_script = dtplot &amp;lt;&amp;lt; get script;
print (dtp_script);
dt &amp;lt;&amp;lt; new script("plot_dt1", dtp_script );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:01:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-script-from-a-plot-and-save-to-the-data-table-in-JSL/m-p/510490#M73782</guid>
      <dc:creator>CurseOfLizard13</dc:creator>
      <dc:date>2023-06-09T17:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get script from a plot and save to the data table in JSL script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-script-from-a-plot-and-save-to-the-data-table-in-JSL/m-p/510496#M73786</link>
      <description>&lt;P&gt;If you use NameExpr(dtp_script), it will return the expression referenced by dtp_script.&amp;nbsp; You can then put that in place of "dtp_script" in your last statement.&amp;nbsp; However, to do that, you will need to get JMP to evaluate NameExpr(dtp_script) before it sends the new script message to the data table.&amp;nbsp; Your last statement should look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
	EvalExpr(
		dt &amp;lt;&amp;lt; New Script("plot_dt1", Expr(Name Expr(dtp_script)))
	)
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For the argument of EvalExpr(), anything that is inside an Expr() gets evaluated in place.&amp;nbsp; EvalExpr() returns an expression with the evaluated value replacing Expr(...).&amp;nbsp; In this case, the expression referenced by dtp_script.&amp;nbsp; I hope this is clear.&amp;nbsp; You can read more about expression manipulation in the Scripting Index (Help -&amp;gt; Scripting Index) or the Scripting Guide (Help -&amp;gt; JMP Documentation Library).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 18:14:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-script-from-a-plot-and-save-to-the-data-table-in-JSL/m-p/510496#M73786</guid>
      <dc:creator>Jasean</dc:creator>
      <dc:date>2022-06-15T18:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get script from a plot and save to the data table in JSL script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-get-script-from-a-plot-and-save-to-the-data-table-in-JSL/m-p/510501#M73789</link>
      <description>&lt;P&gt;Thank you! This is very helpful!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 19:32:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-get-script-from-a-plot-and-save-to-the-data-table-in-JSL/m-p/510501#M73789</guid>
      <dc:creator>CurseOfLizard13</dc:creator>
      <dc:date>2022-06-15T19:32:14Z</dc:date>
    </item>
  </channel>
</rss>

