<?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: Table script - completed? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664467#M85285</link>
    <description>&lt;P&gt;Oh, so simple :)&lt;/img&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2023 16:23:36 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2023-08-01T16:23:36Z</dc:date>
    <item>
      <title>Table script - completed?</title>
      <link>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664332#M85269</link>
      <description>&lt;P&gt;When triggering a Tables script from another script, how can I check if a table script was completed (without errors)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Adding a return function is not allowed:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1690895010741.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55489iB8739365E92E4E7E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1690895010741.png" alt="hogi_0-1690895010741.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;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt &amp;lt;&amp;lt; run Script( "Bivariate" );
dt &amp;lt;&amp;lt; New Script(
	"test", JSL Quote(
		print(1);
		return(1);	
),As String( 1 ));


dt &amp;lt;&amp;lt; New Script(
	"test2", JSL Quote(
		New Namespace("myScript");
		myScript:finished=0;
print(1);
myScript:finished=1;
),
	As String( 1 )
);

If( Not( dt &amp;lt;&amp;lt; run Script( "test" ) ),
	Stop()
);

dt &amp;lt;&amp;lt; run Script( "test2" );
If( Not( myScript:finished ),
	Stop()
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 13:14:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664332#M85269</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-08-01T13:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Table script - completed?</title>
      <link>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664395#M85273</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt &amp;lt;&amp;lt; deletescripts( "test" );

dt &amp;lt;&amp;lt; New Script(
	"test", JSL Quote(
		if(test&amp;lt;0,
			0 // either this is the last value from the if
		,
			print("ok");
			1 // or this is the last value from the if
		); // the if() value is either 0 or 1
	), // the script's value is the last statement executed value
	As String( 1 )
);

test = 37;
Show( test, dt &amp;lt;&amp;lt; run Script( "test" ) ); // "ok",1

test = -42;
Show( test, dt &amp;lt;&amp;lt; run Script( "test" ) ); // 0
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;edit: include() works the same way.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 14:34:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664395#M85273</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2023-08-01T14:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Table script - completed?</title>
      <link>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664467#M85285</link>
      <description>&lt;P&gt;Oh, so simple :)&lt;/img&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/982"&gt;@Craige_Hales&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 16:23:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664467#M85285</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-08-01T16:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Table script - completed?</title>
      <link>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664477#M85286</link>
      <description>&lt;P&gt;For functions there is no difference between the two variants?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;testFunc1= Function({},return(1));
testFunc2= Function({},1);

show(testFunc1);
show(testFunc2);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2023 16:35:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664477#M85286</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-08-01T16:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Table script - completed?</title>
      <link>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664551#M85297</link>
      <description>&lt;P&gt;return(1) has a major advantage if it is nested inside for loops and if statements: it returns the answer without needing to be otherwise positioned to be the last expression evaluated. The implementation of the return(1) in C++ is slower than just ending with the desired expression; you'll notice on short functions that are called millions of times. So in your example I tend to write&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;testFunc2= Function({},
 /*return*/ 1
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;with the comment. Or use return(1) if clarity is more important. The break() and continue() statements work much the same. Using them for clarity, or in a way that executes them infrequently is perfect.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 17:38:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664551#M85297</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2023-08-01T17:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Table script - completed?</title>
      <link>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664563#M85300</link>
      <description>&lt;P&gt;Nice idea with the /*return*/ comment.&lt;/P&gt;&lt;P&gt;I already deleted one of my "1"s - because it looked so unnecessary ;)&lt;/img&gt;&lt;BR /&gt;Some days later, without the direct connection to the deleted "1", it was quite hard to find out what's going wrong ...&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 17:55:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Table-script-completed/m-p/664563#M85300</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-08-01T17:55:05Z</dc:date>
    </item>
  </channel>
</rss>

