<?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: The use of Throw( in scripting in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/The-use-of-Throw-in-scripting/m-p/33872#M20062</link>
    <description>&lt;P&gt;The same is true for Throw(&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2016 11:40:19 GMT</pubDate>
    <dc:creator>hans_deroos</dc:creator>
    <dc:date>2016-12-22T11:40:19Z</dc:date>
    <item>
      <title>The use of Throw( in scripting</title>
      <link>https://community.jmp.com/t5/Discussions/The-use-of-Throw-in-scripting/m-p/33822#M20043</link>
      <description>&lt;P&gt;I&amp;nbsp; use Throw() in my programs to stop the execution for that particular part of the program. This still works in JMP 13 but I sometimes get a new window with a JMP Alert.&amp;nbsp; I can't seem to simulate the problem - It happens in a User Window - the program sees a problem, the program sends a Caption and executes a Throw().&amp;nbsp; In earlier version I only got the Caption now I sometimes get an Alert window as well.&amp;nbsp; I thought Throw() just stops execution. I can use text in the Throw("Hello") and it will in this case get a JMP Alert with the text - if executed on its own I get only the text in the log.&amp;nbsp; I'm not sure what to expect when.&amp;nbsp; Can anybody help.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 11:50:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/The-use-of-Throw-in-scripting/m-p/33822#M20043</guid>
      <dc:creator>hans_deroos</dc:creator>
      <dc:date>2016-12-20T11:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: The use of Throw( in scripting</title>
      <link>https://community.jmp.com/t5/Discussions/The-use-of-Throw-in-scripting/m-p/33841#M20052</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alert dialog triggered by JSL throw in Interactive mode" style="width: 799px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/4629i2173C1EC5D63EA67/image-size/large?v=v2&amp;amp;px=999" role="button" title="throw.PNG" alt="Alert dialog triggered by JSL throw in Interactive mode" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Alert dialog triggered by JSL throw in Interactive mode&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When JSL runs from a button script&amp;nbsp;it is running in interactive mode and produces alert dialogs when JMP&amp;nbsp;thinks you should&amp;nbsp;know what happened. If you run a script by submitting it, JSL runs in batch mode and just sends alerts&amp;nbsp;to the log. I think in your case you probably want to use stop() rather than throw("msg").&lt;/P&gt;
&lt;P&gt;When you submit this script, it runs in batch mode and brings up a window. When you click a button in the window, the button script runs interactively.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;newwindow("x",
buttonbox("throw(err msg)",setscript(print(1);throw("this is an error message");print(2))),
buttonbox("throw",setscript(print(3);throw();print(4))),
buttonbox("stop",setscript(print(5);stop();print(6))),	
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For each of the buttons, only the first number is printed in the log because the script stops.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 22:30:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/The-use-of-Throw-in-scripting/m-p/33841#M20052</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2016-12-20T22:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: The use of Throw( in scripting</title>
      <link>https://community.jmp.com/t5/Discussions/The-use-of-Throw-in-scripting/m-p/33847#M20053</link>
      <description>&lt;P&gt;Thanks Craige - exactly what I need - the Stop() function.&amp;nbsp; I can't get it the Sctipt Manual though.&lt;/P&gt;&lt;P&gt;I would expect that the 'throw' button in your example would display an empty Alert like below.&amp;nbsp; This is what I get in my own program - as you said it is in an interactive environment &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMP Alert.jpg" style="width: 163px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/4634iBC4A0F52C4613ED3/image-size/small?v=v2&amp;amp;px=200" role="button" title="JMP Alert.jpg" alt="JMP Alert.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 12:03:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/The-use-of-Throw-in-scripting/m-p/33847#M20053</guid>
      <dc:creator>hans_deroos</dc:creator>
      <dc:date>2016-12-21T12:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: The use of Throw( in scripting</title>
      <link>https://community.jmp.com/t5/Discussions/The-use-of-Throw-in-scripting/m-p/33848#M20054</link>
      <description>&lt;P&gt;Another thing about stop(). &amp;nbsp;It seems to only stop the script in the displaybox that holds it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = open("$SAMPLE_DATA\Big Class.jmp");
newwindow("x", &amp;lt;&amp;lt;modal,
	lb = collistbox(dt, all),
	textbox("don't select anything"),
	buttonbox("OK", 
		n = nitems(lb &amp;lt;&amp;lt; Get Selected);
		if(n==0, stop());
		print("Button Stopped");
	)	
);

print("Main Script not stopped");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 12:41:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/The-use-of-Throw-in-scripting/m-p/33848#M20054</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2016-12-21T12:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: The use of Throw( in scripting</title>
      <link>https://community.jmp.com/t5/Discussions/The-use-of-Throw-in-scripting/m-p/33872#M20062</link>
      <description>&lt;P&gt;The same is true for Throw(&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 11:40:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/The-use-of-Throw-in-scripting/m-p/33872#M20062</guid>
      <dc:creator>hans_deroos</dc:creator>
      <dc:date>2016-12-22T11:40:19Z</dc:date>
    </item>
  </channel>
</rss>

