<?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: Help with strange behavior for New Script command in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-Help-with-strange-behavior-for-New-Script-command/m-p/879599#M104297</link>
    <description>&lt;P&gt;I think you are probably right. The evalexpr is going to try to turn the platform's column syntax into a column. It might work this way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt; Expr( Column( DOETable, N Items( ListNames ) ) )
//becomes (untested...)
 Column( Expr(DOETable), expr( N Items (ListNames ) ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The syntax for each platform often uses that function-like structure for grouping, and when the name the platform uses is the same as a function name it is confusing. You'd still need to rearrange because the expr needs to be something that will evaluate to a constant that can be inserted into the expression.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Jun 2025 14:22:41 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2025-06-12T14:22:41Z</dc:date>
    <item>
      <title>JSL: Help with strange behavior for New Script command</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Help-with-strange-behavior-for-New-Script-command/m-p/879578#M104295</link>
      <description>&lt;P&gt;Hello Scripters,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(W11, 64-bit, JMP Pro 18.1.1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I'm having some strange behavior with a script that I'm running. The script does several things, but one thing that it does is to create some new scripts to add to the data table. I have to pass some variables to the New Script and have it run in the data table outside of the original JSL. I am adding two new scripts to the data table. One is for visualizing the data with Graph Builder (it works just fine), the other is visualizing the data with the Distribution platform.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here is the JSL that adds the Graph Builder script (it works great, does exactly what I want it to):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
		Eval Expr(
			DOETable &amp;lt;&amp;lt; New Script(
				"Visualize Graphic Results",
				Current Data Table()&amp;lt;&amp;lt;Graph Builder(
					Size( 1022, 727 ),
					Variables(
						X( Expr( Column( DOETable, 1 ) ) ),
						Y( Expr( Column( DOETable, 2 * Eval( (npreds + 1) ) ) ) ),
						Y( Expr( Column( DOETable, N Items( ListNames ) ) ) ),
						Y( Expr( Column( DOETable, N Items( ListNames ) + 1 ) ) ),
						Y( Expr( Column( DOETable, N Items( ListNames ) + 2 ) ) ),
						Y( Expr( Column( DOETable, N Items( ListNames ) + 3 ) ) ),
						Y( Expr( Column( DOETable, N Items( ListNames ) + 4 ) ) ),
						Y( Expr( Column( DOETable, N Items( ListNames ) + 5 ) ) )
					),
					Elements( Position( 1, 1 ), Points( X, Y, Legend( 55 ) ) ),
					Elements( Position( 1, 2 ), Points( X, Y, Legend( 56 ) ) ),
					Elements( Position( 1, 3 ), Points( X, Y, Legend( 57 ) ) ),
					Elements( Position( 1, 4 ), Points( X, Y, Legend( 58 ) ) ),
					Elements( Position( 1, 5 ), Points( X, Y, Legend( 59 ) ) ),
					Elements( Position( 1, 6 ), Points( X, Y, Legend( 60 ) ) ),
					Elements( Position( 1, 7 ), Points( X, Y, Legend( 61 ) ) )
				)
			)
		)
	);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Similarly, here is the script for the Distribution visualization, which doesn't work as intended:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval(
		Eval Expr(
			DOETable &amp;lt;&amp;lt; New Script(
				"Visualize Distribution Results",
				Current Data Table()&amp;lt;&amp;lt;Distribution(
					Continuous Distribution( Expr( Column( DOETable, 2 * Eval( (npreds + 1) ) ) ) ),
					Process Capability( 0 ),
					Continuous Distribution( Expr( Column( DOETable, N Items( ListNames ) ) ), Process Capability( 0 ) ),
					Continuous Distribution( Expr( Column( DOETable, N Items( ListNames ) + 1 ) ), Process Capability( 0 ) ),
					Continuous Distribution( Expr( Column( DOETable, N Items( ListNames ) + 2 ) ), Process Capability( 0 ) ),
					Continuous Distribution( Expr( Column( DOETable, N Items( ListNames ) + 3 ) ), Process Capability( 0 ) ),
					Continuous Distribution( Expr( Column( DOETable, N Items( ListNames ) + 4 ) ), Process Capability( 0 ) ),
					Continuous Distribution( Expr( Column( DOETable, N Items( ListNames ) + 5 ) ), Process Capability( 0 ) ),
					SendToReport(
						Dispatch( {Expr(ListNames[NItems(Ycols)+1])}, "Quantiles", OutlineBox, {Close( 1 )} ),
						Dispatch( {Expr(ListNames[NItems(Ycols)+2])}, "Quantiles", OutlineBox, {Close( 1 )} ),
						Dispatch( {Expr(ListNames[NItems(Ycols)+3])}, "Quantiles", OutlineBox, {Close( 1 )} ),
						Dispatch( {Expr(ListNames[NItems(Ycols)+4])}, "Quantiles", OutlineBox, {Close( 1 )} ),
						Dispatch( {Expr(ListNames[NItems(Ycols)+5])}, "Quantiles", OutlineBox, {Close( 1 )} ),
						Dispatch( {Expr(ListNames[NItems(Ycols)+6])}, "Quantiles", OutlineBox, {Close( 1 )} ),
						Dispatch( {Expr(ListNames[NItems(Ycols)+7])}, "Quantiles", OutlineBox, {Close( 1 )} )
					)
				)
			)
		)
	);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; When I run the parent script, the two new table scripts are added (again the GB script works just fine), but when I try to run the Distribution script from the data table (green triangle), instead of showing the results, it opens up the Distribution platform window.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SDF1_0-1749735408022.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76843i57FDB333BC7A2A58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SDF1_0-1749735408022.png" alt="SDF1_0-1749735408022.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SDF1_2-1749735475257.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76845i1E9571AFD2ACBFEF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SDF1_2-1749735475257.png" alt="SDF1_2-1749735475257.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;NOTE: names have been removed to protect the innocent ;-).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; First off, it shouldn't do this, it should actually bring up all the distributions as laid out in the new script (when I run the script stepwise in the parent JSL, it works).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Here's the very strange part. If I open up the new script in the data table (Edit Script), and click Run, it works exactly as intended.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SDF1_3-1749735688131.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76846iA545DE7F81730152/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SDF1_3-1749735688131.png" alt="SDF1_3-1749735688131.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SDF1_4-1749736010450.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/76847i5746AC9063CF5B38/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SDF1_4-1749736010450.png" alt="SDF1_4-1749736010450.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I can't figure out what I'm doing wrong -- the JSL works, but for whatever reason, when I try to run it from the green triangle, it doesn't work, which doesn't make sense to me. Have I missed something or have a wrong call/command somewhere? Have others come across this strange behavior, and if so, how did you get around it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Any help is much appreciated, thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 13:51:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Help-with-strange-behavior-for-New-Script-command/m-p/879578#M104295</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2025-06-12T13:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Help with strange behavior for New Script command</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Help-with-strange-behavior-for-New-Script-command/m-p/879597#M104296</link>
      <description>&lt;P&gt;My first guess is the usage of Column().&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Distribution platform has horribly named argument "Column". Notice how columns are inputted here&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
obj = dt &amp;lt;&amp;lt; Distribution(Column(:Age, :Weight));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;compared to graph builder&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = Graph Builder(
	Variables(X(:height), Y(:weight)),
	Elements(Points(X, Y), Smoother(X, Y))
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;LI-SPOILER&gt;Column() isn't used with Graph builder it uses X(), Y() and so on&lt;/LI-SPOILER&gt;</description>
      <pubDate>Thu, 12 Jun 2025 14:01:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Help-with-strange-behavior-for-New-Script-command/m-p/879597#M104296</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-06-12T14:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Help with strange behavior for New Script command</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Help-with-strange-behavior-for-New-Script-command/m-p/879599#M104297</link>
      <description>&lt;P&gt;I think you are probably right. The evalexpr is going to try to turn the platform's column syntax into a column. It might work this way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt; Expr( Column( DOETable, N Items( ListNames ) ) )
//becomes (untested...)
 Column( Expr(DOETable), expr( N Items (ListNames ) ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The syntax for each platform often uses that function-like structure for grouping, and when the name the platform uses is the same as a function name it is confusing. You'd still need to rearrange because the expr needs to be something that will evaluate to a constant that can be inserted into the expression.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 14:22:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Help-with-strange-behavior-for-New-Script-command/m-p/879599#M104297</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2025-06-12T14:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: Help with strange behavior for New Script command</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Help-with-strange-behavior-for-New-Script-command/m-p/879642#M104301</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;and &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Actually, the problem was a bit of a mix of both. For one, the Column() call should not have been in the Expr() call. Two, the proper reference to the column for the Distribution platform needed to be used, but because I'm saving this as a data table script within the parent JSL, I can't just refence the column as :"name"n, I have to build that within and Eval Insert(), and also Parse() it within and Expr() call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; What ended up working for the Distribution platform was the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	Eval(
		Eval Expr(
			Distribution(
				Continuous Distribution( Column( Expr( Parse( Eval Insert( ":\!"^ListNames[Nitems(YCols)+1]^\!"" || "n" ) ) ) ) ),
				Process Capability( 0 )
			)
		)
	);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp; This built the proper column name reference for the Distribution platform and allowed for an executable script that could be saved to the data table. A bit cumbersome in my opinion, but it works, and that's what matters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your suggestions!&lt;/P&gt;
&lt;P&gt;DS&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 18:19:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Help-with-strange-behavior-for-New-Script-command/m-p/879642#M104301</guid>
      <dc:creator>SDF1</dc:creator>
      <dc:date>2025-06-12T18:19:33Z</dc:date>
    </item>
  </channel>
</rss>

