<?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: Cannot perform math on returned value from Number Edit Box in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370535#M62022</link>
    <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I think this does not work, because with closing the window, the variable and the scope has gone. JMP returns it in a different way. A global variable may work.&lt;/P&gt;&lt;P&gt;So when I struggle with these kind of things, I tend to look in the scripting index for the current way to do this kind of things (they may change somehow from version to version). And I find it as an example for "new window, modal", that I slightly modified, see screenshot and attached script. The reference of the window returns all you need.&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 );

ex = New Window( "Dialog() example",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;Return Result,
	V List Box(
		H List Box( "Set this value", variable = Number Edit Box( 42 ) ),
		H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
	)
);

Show( ex );
Show( ex["variable"] );
neb_content = ex["variable"];
Show( neb_content / 2 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Georg_0-1616483029871.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31452iE0B06D7FE8D0512C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Georg_0-1616483029871.png" alt="Georg_0-1616483029871.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Mar 2021 07:07:03 GMT</pubDate>
    <dc:creator>Georg</dc:creator>
    <dc:date>2021-03-23T07:07:03Z</dc:date>
    <item>
      <title>Cannot perform math on returned value from Number Edit Box</title>
      <link>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370502#M62019</link>
      <description>&lt;P&gt;I'm trying to run a very simple script that requests a numerical input from the user. Unfortunately, I cannot perform numerical operations such as subtract and divide on the returned value. Am quite new to jsl, so I must be doing something wrong that must be very simple to correct. the error message is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Cannot convert argument to a number [or matrix] in access or evaluation of 'Divide', minfeat_abs/ /*###*/1000/*###*/"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated. Have been banging away at this for hours.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see the script below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;win = New Window( "Feature Depth" ,
&amp;lt;&amp;lt;Modal,
&amp;lt;&amp;lt;Return Result,
Text Box( "Input Min Feature Depth" ),
minfeat_abs = Number Edit Box( 4 ),
);
minfeat = -minfeat_abs/1000;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:09:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370502#M62019</guid>
      <dc:creator>dsoltz1</dc:creator>
      <dc:date>2023-06-09T22:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot perform math on returned value from Number Edit Box</title>
      <link>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370521#M62020</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I did struggle with the proper way to get values out of modal windows until&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt; showed me how:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here (1);

win = New Window( "Feature Depth" ,
		&amp;lt;&amp;lt;Modal,
		&amp;lt;&amp;lt;Return Result,
		Text Box( "Input Min Feature Depth" ),
		NEB = Number Edit Box(4)

);

minfeat_abs = NEB &amp;lt;&amp;lt; get;
show (minfeat_abs);
minfeat = -minfeat_abs/1000;
show (minfeat);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Mar 2021 04:57:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370521#M62020</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2021-03-23T04:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot perform math on returned value from Number Edit Box</title>
      <link>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370527#M62021</link>
      <description>&lt;P&gt;Still getting an error, even when I copy and past the script that Thierry suggested.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;deleted object reference: NEB &amp;lt;&amp;lt; get in access or evaluation of 'Glue'...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dsoltz1_0-1616476264230.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31451i51FE0E2446BC2598/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dsoltz1_0-1616476264230.png" alt="dsoltz1_0-1616476264230.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 05:11:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370527#M62021</guid>
      <dc:creator>dsoltz1</dc:creator>
      <dc:date>2021-03-23T05:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot perform math on returned value from Number Edit Box</title>
      <link>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370535#M62022</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I think this does not work, because with closing the window, the variable and the scope has gone. JMP returns it in a different way. A global variable may work.&lt;/P&gt;&lt;P&gt;So when I struggle with these kind of things, I tend to look in the scripting index for the current way to do this kind of things (they may change somehow from version to version). And I find it as an example for "new window, modal", that I slightly modified, see screenshot and attached script. The reference of the window returns all you need.&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 );

ex = New Window( "Dialog() example",
	&amp;lt;&amp;lt;Modal,
	&amp;lt;&amp;lt;Return Result,
	V List Box(
		H List Box( "Set this value", variable = Number Edit Box( 42 ) ),
		H List Box( Button Box( "OK" ), Button Box( "Cancel" ) )
	)
);

Show( ex );
Show( ex["variable"] );
neb_content = ex["variable"];
Show( neb_content / 2 );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Georg_0-1616483029871.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31452iE0B06D7FE8D0512C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Georg_0-1616483029871.png" alt="Georg_0-1616483029871.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 07:07:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370535#M62022</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2021-03-23T07:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot perform math on returned value from Number Edit Box</title>
      <link>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370545#M62025</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;win = New Window( "Feature Depth" ,
&amp;lt;&amp;lt;Modal,
&amp;lt;&amp;lt;Return Result,
Text Box( "Input Min Feature Depth" ),
minfeat_abs = Number Edit Box( 4 ),
);

mf = win["minfeat_abs"];

mf = -mf/1000;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I think it has something to do with the &amp;lt;&amp;lt;modal mode&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 09:14:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370545#M62025</guid>
      <dc:creator>Mauro_Gerber</dc:creator>
      <dc:date>2021-03-23T09:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot perform math on returned value from Number Edit Box</title>
      <link>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370631#M62039</link>
      <description>&lt;P&gt;This script performed properly by itself, but when combined with a script to select rows in a table against a given criteria (number greater than neb_content/2 for example) it gave the error: Name Unresolved: Feature{1} in access or evaluation of 'Feature' , Feature/*###*/&lt;/P&gt;&lt;P&gt;where "Feature" was the name of the column in the data table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to understand why this is occurring.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the tip on using the scripting guide with each jmp version is a good one. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 14:16:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370631#M62039</guid>
      <dc:creator>dsoltz1</dc:creator>
      <dc:date>2021-03-23T14:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot perform math on returned value from Number Edit Box</title>
      <link>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370682#M62046</link>
      <description>&lt;P&gt;Please see &lt;A href="https://www.jmp.com/support/help/en/15.2/index.shtml#page/jmp/extract-values-from-a-window.shtml#ww515896" target="_self"&gt;Help&lt;/A&gt; for this topic.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 16:05:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Cannot-perform-math-on-returned-value-from-Number-Edit-Box/m-p/370682#M62046</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-03-23T16:05:23Z</dc:date>
    </item>
  </channel>
</rss>

