<?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 Script used to work in JMP14 but not working in JMP16 in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-used-to-work-in-JMP14-but-not-working-in-JMP16/m-p/427616#M67710</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I just encountered 2 problems with my script in a Modal Window which used to be working fine in JMP14 but as soon as I moved over JMP16, these 2 problems were found:&lt;/P&gt;
&lt;P&gt;1) There's an error message came out stating "&lt;STRONG&gt;deleted object reference: cc &amp;lt;&amp;lt; Get Selected in access or evaluation of 'Glue',.....&lt;/STRONG&gt;"&lt;/P&gt;
&lt;P&gt;2) "Cancel" button shows an error &lt;STRONG&gt;" Name Unresolved: Button in access or evaluation of 'Button', Button (-1) /*###*/ "&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is a simplified script that is working fine in JMP14 but not in JMP16. If working correctly, the script will create a New column ("Result") stating "Pass" if the checkbox is checked, but a "Fail" if the checkbox is unchecked. About the "Cancel" button, if working properly, there'll be no error message when clicked, where it will close the Modal Window.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

win = New Window( "User Input",
	&amp;lt;&amp;lt;Modal,
	Lineup Box( N Col( 1 ), 

		cchk = {"Pass"};

		Panel Box( "Result",
			cc = Check Box( cchk ),
			cc &amp;lt;&amp;lt; Set( 1, 1 ),
			Spacer Box( Size( 1, 0 ) )
		);, 

		H List Box( Spacer Box(), Button Box( "OK" ), Button Box( "Cancel" ) ),

	)
);

If( win["Button"] == -1,
	win &amp;lt;&amp;lt; Close Window
);

ctc = cc &amp;lt;&amp;lt; Get Selected;

dt &amp;lt;&amp;lt; New Column( "Result", character, nominal );

If( Contains( ctc, "Pass" ), 
	dt:Result &amp;lt;&amp;lt; Set Each Value( "Pass" )
,
	dt:Result &amp;lt;&amp;lt; Set Each Value( "Fail" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 18:02:55 GMT</pubDate>
    <dc:creator>brandon_mcrv</dc:creator>
    <dc:date>2023-06-09T18:02:55Z</dc:date>
    <item>
      <title>Script used to work in JMP14 but not working in JMP16</title>
      <link>https://community.jmp.com/t5/Discussions/Script-used-to-work-in-JMP14-but-not-working-in-JMP16/m-p/427616#M67710</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I just encountered 2 problems with my script in a Modal Window which used to be working fine in JMP14 but as soon as I moved over JMP16, these 2 problems were found:&lt;/P&gt;
&lt;P&gt;1) There's an error message came out stating "&lt;STRONG&gt;deleted object reference: cc &amp;lt;&amp;lt; Get Selected in access or evaluation of 'Glue',.....&lt;/STRONG&gt;"&lt;/P&gt;
&lt;P&gt;2) "Cancel" button shows an error &lt;STRONG&gt;" Name Unresolved: Button in access or evaluation of 'Button', Button (-1) /*###*/ "&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is a simplified script that is working fine in JMP14 but not in JMP16. If working correctly, the script will create a New column ("Result") stating "Pass" if the checkbox is checked, but a "Fail" if the checkbox is unchecked. About the "Cancel" button, if working properly, there'll be no error message when clicked, where it will close the Modal Window.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

win = New Window( "User Input",
	&amp;lt;&amp;lt;Modal,
	Lineup Box( N Col( 1 ), 

		cchk = {"Pass"};

		Panel Box( "Result",
			cc = Check Box( cchk ),
			cc &amp;lt;&amp;lt; Set( 1, 1 ),
			Spacer Box( Size( 1, 0 ) )
		);, 

		H List Box( Spacer Box(), Button Box( "OK" ), Button Box( "Cancel" ) ),

	)
);

If( win["Button"] == -1,
	win &amp;lt;&amp;lt; Close Window
);

ctc = cc &amp;lt;&amp;lt; Get Selected;

dt &amp;lt;&amp;lt; New Column( "Result", character, nominal );

If( Contains( ctc, "Pass" ), 
	dt:Result &amp;lt;&amp;lt; Set Each Value( "Pass" )
,
	dt:Result &amp;lt;&amp;lt; Set Each Value( "Fail" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 18:02:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-used-to-work-in-JMP14-but-not-working-in-JMP16/m-p/427616#M67710</guid>
      <dc:creator>brandon_mcrv</dc:creator>
      <dc:date>2023-06-09T18:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Script used to work in JMP14 but not working in JMP16</title>
      <link>https://community.jmp.com/t5/Discussions/Script-used-to-work-in-JMP14-but-not-working-in-JMP16/m-p/427626#M67711</link>
      <description>&lt;P&gt;In general I've found that JMP16 is a bit more aggressive about deleting display boxes immediately.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, the way that I've always used &lt;CODE class=""&gt;Modal&lt;/CODE&gt; windows is by utilizing the &lt;CODE class=""&gt;OnValidate&lt;/CODE&gt; function -- this is typically reserved for determining whether the window should close (perhaps not all required inputs are filled out and you don't want the window to close via the 'OK' button.)&amp;nbsp; Just be sure to return a &lt;CODE class=""&gt;1&lt;/CODE&gt; for proper window closing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;Names Default To Here( 1 );
dt = Current Data Table();

win = New Window( "User Input",
	&amp;lt;&amp;lt;Modal
,
	&amp;lt;&amp;lt;On Validate(
		ctc = cc &amp;lt;&amp;lt; Get Selected;
		dt &amp;lt;&amp;lt; New Column( "Result", character, nominal );
		If( Contains( ctc, "Pass" ), 
			dt:Result &amp;lt;&amp;lt; Set Each Value( "Pass" )
		,
			dt:Result &amp;lt;&amp;lt; Set Each Value( "Fail" )
		);
		1
	)
,
	Lineup Box( N Col( 1 ), 
		cchk = {"Pass"};
		Panel Box( "Result",
			cc = Check Box( cchk, &amp;lt;&amp;lt; Set( 1, 1 ) ),
			Spacer Box( Size( 1, 0 ) )
		)
	,
		H List Box(
			Button Box( "OK" )
		,
			Spacer Box( &amp;lt;&amp;lt;Set Auto Stretching( 1, 0 ) )
		,
			Button Box( "Cancel" )
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 13:30:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-used-to-work-in-JMP14-but-not-working-in-JMP16/m-p/427626#M67711</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2021-10-18T13:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script used to work in JMP14 but not working in JMP16</title>
      <link>https://community.jmp.com/t5/Discussions/Script-used-to-work-in-JMP14-but-not-working-in-JMP16/m-p/430928#M68065</link>
      <description>&lt;P&gt;&amp;nbsp;Hi, really sorry for the late reply. I have been busy with work for the past 2 weeks. Thanks for the solution. It works and I learnt something new. Appreciate that !&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 03:47:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-used-to-work-in-JMP14-but-not-working-in-JMP16/m-p/430928#M68065</guid>
      <dc:creator>brandon_mcrv</dc:creator>
      <dc:date>2021-10-28T03:47:21Z</dc:date>
    </item>
  </channel>
</rss>

