<?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 Need help with random errors on script start AFTER the previous run finished in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Need-help-with-random-errors-on-script-start-AFTER-the-previous/m-p/919603#M107866</link>
    <description>&lt;P&gt;Never mind, I figured it out - one of the functions had Eval() which was evaluating right when script starts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;I am writing a simple GUI prototype:&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;List of tables in a combo box, button to add\open table and Filter Col Box with column names of the currently selected table.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Everything works on the first run - tables are switched, columns are displayed, combobox reacts to tables being added, closed or renamed.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;I'm using subscription to tables for that.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;After I close GUI window and start the script AGAIN, I'm getting random errors connected to symbols not being defined (it's a new instance running). As if on start it keeps running pieces of code in random places from previous instance and not finding variables defined in those pieces.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;I click OK on error pop-up and run again - script working normally&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Here's my window onClose function:&lt;/STRIKE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;STRIKE&gt;&lt;CODE class=" language-jsl"&gt;onWindowCloseExpr = Expr(
	Write("\!nRunning on window close expression");
	For Each({_dt, _index}, (data:tablesListAA &amp;lt;&amp;lt; Get Values),
		Close(_dt, NoSave);
	);
	Unsubscribe to Data Table List( aSub );
	Clear Symbols();
	Stop();
);&lt;/CODE&gt;&lt;/STRIKE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRIKE&gt;I added Clear Symbols() and Stop() while trying to troubleshoot the issue, to make sure script stops and everything cleared.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Any idea what's happening and how to fix?&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Dec 2025 19:13:58 GMT</pubDate>
    <dc:creator>miguello</dc:creator>
    <dc:date>2025-12-15T19:13:58Z</dc:date>
    <item>
      <title>Need help with random errors on script start AFTER the previous run finished</title>
      <link>https://community.jmp.com/t5/Discussions/Need-help-with-random-errors-on-script-start-AFTER-the-previous/m-p/919603#M107866</link>
      <description>&lt;P&gt;Never mind, I figured it out - one of the functions had Eval() which was evaluating right when script starts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;I am writing a simple GUI prototype:&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;List of tables in a combo box, button to add\open table and Filter Col Box with column names of the currently selected table.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Everything works on the first run - tables are switched, columns are displayed, combobox reacts to tables being added, closed or renamed.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;I'm using subscription to tables for that.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;After I close GUI window and start the script AGAIN, I'm getting random errors connected to symbols not being defined (it's a new instance running). As if on start it keeps running pieces of code in random places from previous instance and not finding variables defined in those pieces.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;I click OK on error pop-up and run again - script working normally&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Here's my window onClose function:&lt;/STRIKE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;STRIKE&gt;&lt;CODE class=" language-jsl"&gt;onWindowCloseExpr = Expr(
	Write("\!nRunning on window close expression");
	For Each({_dt, _index}, (data:tablesListAA &amp;lt;&amp;lt; Get Values),
		Close(_dt, NoSave);
	);
	Unsubscribe to Data Table List( aSub );
	Clear Symbols();
	Stop();
);&lt;/CODE&gt;&lt;/STRIKE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRIKE&gt;I added Clear Symbols() and Stop() while trying to troubleshoot the issue, to make sure script stops and everything cleared.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Any idea what's happening and how to fix?&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Dec 2025 19:13:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Need-help-with-random-errors-on-script-start-AFTER-the-previous/m-p/919603#M107866</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2025-12-15T19:13:58Z</dc:date>
    </item>
  </channel>
</rss>

