<?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 Insert a Expr() object into another script as an unevaluated Expr() object to be used later? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/849159#M102511</link>
    <description>&lt;P&gt;Adding to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;'s&amp;nbsp;answer at&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Insert-contents-of-Parse-expression-rather-than-variable-name/m-p/849139?utm_campaign=cm&amp;amp;emcs_t=S2h8ZW1haWx8dG9waWNfc3Vic2NyaXB0aW9ufE04SjRKNVJORkJDVkFYfDg0OTEzOXxTVUJTQ1JJUFRJT05TfGhL&amp;amp;utm_medium=notification&amp;amp;utm_source=general#M102506" target="_self"&gt;Insert contents of Parse expression rather than variable name into New Script&lt;/A&gt;, how to insert a Expr() object into another script as an unevaluated Expr() object to be used later?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am using JMP 18.1.2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = New Table( "My Table" );

e1 = Expr(
	Print( "Run some code." )
);

e2 = Expr(
	e1;
	Print( "Run some other code." );
);

e3 = Eval Expr(
	Expr( Name Expr( e1 ) ); // Define, but do not evaluate e1 here.
	Expr( Name Expr( e2 ) ); // Evaluate e1 here.
);
Show( e3 );

Eval( Eval Expr( dt &amp;lt;&amp;lt; New Script( "Test", Expr( Name Expr( e3 ) ) ) ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 21 Mar 2025 20:36:55 GMT</pubDate>
    <dc:creator>robot</dc:creator>
    <dc:date>2025-03-21T20:36:55Z</dc:date>
    <item>
      <title>Insert a Expr() object into another script as an unevaluated Expr() object to be used later?</title>
      <link>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/849159#M102511</link>
      <description>&lt;P&gt;Adding to&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;'s&amp;nbsp;answer at&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://community.jmp.com/t5/Discussions/Insert-contents-of-Parse-expression-rather-than-variable-name/m-p/849139?utm_campaign=cm&amp;amp;emcs_t=S2h8ZW1haWx8dG9waWNfc3Vic2NyaXB0aW9ufE04SjRKNVJORkJDVkFYfDg0OTEzOXxTVUJTQ1JJUFRJT05TfGhL&amp;amp;utm_medium=notification&amp;amp;utm_source=general#M102506" target="_self"&gt;Insert contents of Parse expression rather than variable name into New Script&lt;/A&gt;, how to insert a Expr() object into another script as an unevaluated Expr() object to be used later?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am using JMP 18.1.2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = New Table( "My Table" );

e1 = Expr(
	Print( "Run some code." )
);

e2 = Expr(
	e1;
	Print( "Run some other code." );
);

e3 = Eval Expr(
	Expr( Name Expr( e1 ) ); // Define, but do not evaluate e1 here.
	Expr( Name Expr( e2 ) ); // Evaluate e1 here.
);
Show( e3 );

Eval( Eval Expr( dt &amp;lt;&amp;lt; New Script( "Test", Expr( Name Expr( e3 ) ) ) ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Mar 2025 20:36:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/849159#M102511</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2025-03-21T20:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a Expr() object into another script as an unevaluated Expr() object to be used later?</title>
      <link>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/849201#M102514</link>
      <description>&lt;P&gt;A nice trick in JMP:&lt;BR /&gt;you can press the Enter Key on the numeric keyboard to run one line of code.&lt;BR /&gt;This is very helpful for debugging.&lt;BR /&gt;&lt;BR /&gt;another trick:&lt;BR /&gt;right click into the script window and activate:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1742594035590.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/74096i66CAE5C0C319A6EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1742594035590.png" alt="hogi_0-1742594035590.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the last trick:&lt;BR /&gt;mark the &lt;FONT face="courier new,courier"&gt;Eval Expr(...)&lt;/FONT&gt; inside an &lt;FONT face="courier new,courier"&gt;Eval()&lt;/FONT&gt;&amp;nbsp;and "run" it to check if the expression is what you expect:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_1-1742594140326.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/74097i6990FE6A91916287/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1742594140326.png" alt="hogi_1-1742594140326.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This shows that where you write&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-jsl"&gt;&lt;CODE&gt;// Evaluate e1 here.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Name Expr&lt;/FONT&gt; just takes the Expression which is stored in the variable. It doesn't evaluate it. &lt;FONT face="courier new,courier"&gt;e1&lt;/FONT&gt; stays&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;e1&lt;/FONT&gt;.&lt;BR /&gt;&lt;BR /&gt;Edit:&lt;BR /&gt;But maybe this is what you want to achieve? No question - just a comment?&lt;BR /&gt;The JSL script will write "e1" into the table script.&lt;BR /&gt;And JMP will try to evaluate e1 when the user runs the table script.&lt;BR /&gt;&lt;BR /&gt;This means: you have to define e1 in the context of the data table, otherwise you will get an error message:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1742630908107.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/74109i10693A6B6AC39AF8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1742630908107.png" alt="hogi_0-1742630908107.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[e1 is just defined within the here namespace of the script]&lt;/P&gt;</description>
      <pubDate>Sat, 22 Mar 2025 08:10:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/849201#M102514</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-03-22T08:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a Expr() object into another script as an unevaluated Expr() object to be used later?</title>
      <link>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/849221#M102518</link>
      <description>&lt;P&gt;I'm not exactly sure what you are going for as e1 has already been defined on line 5. What do you wish to have inside e3? Something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;e1 = Expr(Print("Code"));
e1; //e2
Print("Code2"); //e2&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;e1 = Expr(Print("Code"));
Print("Code");
Print("Code2");&amp;nbsp;//e2&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Mar 2025 05:49:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/849221#M102518</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-03-22T05:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a Expr() object into another script as an unevaluated Expr() object to be used later?</title>
      <link>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/851406#M102564</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;for the input.&amp;nbsp; I was able to achieve the result I was looking for by using a function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

dt = New Table( "My Table" );

e1 = Expr(
	f1 = Function( {},
		{Default Local},
		Print( "Run some code." )
	)
);

e2 = Expr(
	f1();
	Print( "Run some other code." );
);

e3 = Expr(
	f1();
	Print( "Run even more code." );
);

e4 = Eval Expr(
	Expr( Name Expr( e1 ) ); // Define, but do not evaluate e1 here.
	Expr( Name Expr( e2 ) ); // Evaluate e1 here.
	Expr( Name Expr( e3 ) ); // Evaluate e1 here.
);

Eval( Eval Expr( dt &amp;lt;&amp;lt; New Script( "Test", Expr( Name Expr( e4 ) ) ) ) );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Mar 2025 16:16:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/851406#M102564</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2025-03-24T16:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a Expr() object into another script as an unevaluated Expr() object to be used later?</title>
      <link>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/851496#M102566</link>
      <description>&lt;P&gt;You can also wrap it into extra Expr&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("My Table");

e0 = Expr(e1 = Expr(Print("Run some code.")));

e2 = Expr(
	e1;
	Print("Run some other code.");
);

e3 = Eval Expr(
	Expr(Name Expr(e0)); // Define, but do not evaluate e1 here.
	Expr(Name Expr(e2)); // Evaluate e1 here.
);
Show(e3);

Eval(Eval Expr(dt &amp;lt;&amp;lt; New Script("Test", Expr(Name Expr(e3)))));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1742833430942.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/74172i21E6BEBF4DB04642/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1742833430942.png" alt="jthi_0-1742833430942.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2025 16:23:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/851496#M102566</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-03-24T16:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Insert a Expr() object into another script as an unevaluated Expr() object to be used later?</title>
      <link>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/851651#M102568</link>
      <description>&lt;P&gt;Very clever!&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2025 16:38:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Insert-a-Expr-object-into-another-script-as-an-unevaluated-Expr/m-p/851651#M102568</guid>
      <dc:creator>robot</dc:creator>
      <dc:date>2025-03-24T16:38:15Z</dc:date>
    </item>
  </channel>
</rss>

