<?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 Suppress Eval all column formula in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Suppress-Eval-all-column-formula/m-p/451933#M69873</link>
    <description>&lt;P&gt;I was trying to use the script below to suppress eval or allow eval for all column formula in the table. For some reason, I kept getting an error (see snapshot) on the third time running the script but I can't particularly find the bug. Appreciate the community help in debugging this.&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 = current data table();

try(formula_suppress = dt:Formula_Suppress,
	dt &amp;lt;&amp;lt; set table variable("Formula_Suppress",1);
	formula_suppress = 1;
);
wait(0.5);

formula_suppress = abs(formula_suppress - 1);
dt &amp;lt;&amp;lt; set table variable("Formula_Suppress",formula_suppress);
//show(formula_suppres);

for(i=1,i&amp;lt;=ncol(dt),i++,
	as column(dt,i) &amp;lt;&amp;lt; suppress eval(formula_suppress)
);

if(formula_suppress == 1,
	status = "Suppressed",
	status = "Evaluated"
);

NewWindow("Alert",
	showToolbars(0),showMenu(0),BorderBox(top(15),bottom(15),left(15),right(15),
		VListBox(
			TextBox("Formulas in the table are " || char(status),&amp;lt;&amp;lt;setFontStyle("bold"),&amp;lt;&amp;lt;fontcolor("red")),
			SpacerBox(size(0,15)),
		HCenterBox(ButtonBox("         close         ",current window()&amp;lt;&amp;lt;close window ))
		)
	)
);

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Djtjhin_0-1642478016718.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/39043i46DFD91CAF2CC58E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Djtjhin_0-1642478016718.png" alt="Djtjhin_0-1642478016718.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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jun 2023 23:42:46 GMT</pubDate>
    <dc:creator>Djtjhin</dc:creator>
    <dc:date>2023-06-10T23:42:46Z</dc:date>
    <item>
      <title>Suppress Eval all column formula</title>
      <link>https://community.jmp.com/t5/Discussions/Suppress-Eval-all-column-formula/m-p/451933#M69873</link>
      <description>&lt;P&gt;I was trying to use the script below to suppress eval or allow eval for all column formula in the table. For some reason, I kept getting an error (see snapshot) on the third time running the script but I can't particularly find the bug. Appreciate the community help in debugging this.&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 = current data table();

try(formula_suppress = dt:Formula_Suppress,
	dt &amp;lt;&amp;lt; set table variable("Formula_Suppress",1);
	formula_suppress = 1;
);
wait(0.5);

formula_suppress = abs(formula_suppress - 1);
dt &amp;lt;&amp;lt; set table variable("Formula_Suppress",formula_suppress);
//show(formula_suppres);

for(i=1,i&amp;lt;=ncol(dt),i++,
	as column(dt,i) &amp;lt;&amp;lt; suppress eval(formula_suppress)
);

if(formula_suppress == 1,
	status = "Suppressed",
	status = "Evaluated"
);

NewWindow("Alert",
	showToolbars(0),showMenu(0),BorderBox(top(15),bottom(15),left(15),right(15),
		VListBox(
			TextBox("Formulas in the table are " || char(status),&amp;lt;&amp;lt;setFontStyle("bold"),&amp;lt;&amp;lt;fontcolor("red")),
			SpacerBox(size(0,15)),
		HCenterBox(ButtonBox("         close         ",current window()&amp;lt;&amp;lt;close window ))
		)
	)
);

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Djtjhin_0-1642478016718.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/39043i46DFD91CAF2CC58E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Djtjhin_0-1642478016718.png" alt="Djtjhin_0-1642478016718.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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:42:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Suppress-Eval-all-column-formula/m-p/451933#M69873</guid>
      <dc:creator>Djtjhin</dc:creator>
      <dc:date>2023-06-10T23:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Suppress Eval all column formula</title>
      <link>https://community.jmp.com/t5/Discussions/Suppress-Eval-all-column-formula/m-p/451940#M69874</link>
      <description>&lt;P&gt;The syntax error that was causing the failure was because the&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;formula_suppress = dt:Formula_Suppress,&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;was not returning what you were expecting.&amp;nbsp; Below is a rework of the code that returns properly when the Table Variable does not exist&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);

dt = current data table();

if(try(isempty(dt:Formula_Suppress),1) == 1,
	dt &amp;lt;&amp;lt; set table variable("Formula_Suppress",1);
	formula_suppress = 1;
);
wait(0.5);

formula_suppress = abs(formula_suppress - 1);
dt &amp;lt;&amp;lt; set table variable("Formula_Suppress",formula_suppress);
//show(formula_suppres);

for(i=1,i&amp;lt;=ncol(dt),i++,
	as column(dt,i) &amp;lt;&amp;lt; suppress eval(formula_suppress)
);

if(formula_suppress == 1,
	status = "Suppressed",
	status = "Evaluated"
);

NewWindow("Alert",
	showToolbars(0),showMenu(0),BorderBox(top(15),bottom(15),left(15),right(15),
		VListBox(
			TextBox("Formulas in the table are " || char(status),&amp;lt;&amp;lt;setFontStyle("bold"),&amp;lt;&amp;lt;fontcolor("red")),
			SpacerBox(size(0,15)),
		HCenterBox(ButtonBox("         close         ",current window()&amp;lt;&amp;lt;close window ))
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jan 2022 05:18:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Suppress-Eval-all-column-formula/m-p/451940#M69874</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-01-18T05:18:36Z</dc:date>
    </item>
  </channel>
</rss>

