<?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: JSL: if - else -&amp;gt; find the commas? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573544#M78255</link>
    <description>&lt;P&gt;JMP should hire you into a product quality role! Love it!&lt;/P&gt;</description>
    <pubDate>Fri, 25 Nov 2022 14:15:49 GMT</pubDate>
    <dc:creator>pauldeen</dc:creator>
    <dc:date>2022-11-25T14:15:49Z</dc:date>
    <item>
      <title>JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573281#M78226</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I often face the problem that a code doesn't work because 1 out of 10 semicolons is a comma or one comma which belongs to the if block is actually missing.&lt;/P&gt;&lt;P&gt;Is there an easy trick to make the blocks in an if-else clause more visible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Sep 2023 20:08:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573281#M78226</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-09-13T20:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573295#M78228</link>
      <description>&lt;P&gt;Right click on the JSL window, and select "Reformat Script".&lt;/P&gt;
&lt;P&gt;That will align the blocks at standard indentations.&lt;/P&gt;
&lt;P&gt;You can also click on any function or matrix boundary bracket {} [] and it will select the matching bracket&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Nov 2022 20:53:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573295#M78228</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-11-24T20:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573448#M78248</link>
      <description>&lt;P&gt;I liked &lt;A href="http://www.pega-analytics.co.uk/blog/oneway-advisor-step-1/" target="_self"&gt;what this man had to say here&lt;/A&gt;.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;JMP doesn’t care about this formatting but you will quickly get into a mess if you don’t have the discipline to write the code in a way that reflects the hierarchy of display boxes.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;This statement doesn't exclusively apply to display boxes, but JSL in general. I am still learning myself, but it&amp;nbsp;is a good investment of time to visually structure code into logical parts, even if it sometimes turns into a forensic exercise (which, coincindentally, is where most learning tends to happen).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2022 08:36:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573448#M78248</guid>
      <dc:creator>Ressel</dc:creator>
      <dc:date>2022-11-25T08:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573510#M78251</link>
      <description>&lt;P&gt;Hm, I just thought:&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there is this wonderful GraphBuilder in Jmp which helps you to generate every kind of graph within 5 seconds,&lt;/P&gt;&lt;P&gt;it should also be possible to analyze complicated If &amp;amp; Match structures&amp;nbsp;in &amp;lt; 5 seconds to find any error in the structure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Automatic indentation via "reformat script" is great - it shows the complete hierarchy of the code structure - at a single glance.&lt;/P&gt;&lt;P&gt;But that's also the disadvantage: The &lt;EM&gt;complete&lt;/EM&gt; hierarchy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is why a human eye needs some time to analyze the information - and even needs some support from the brain to do so.&lt;BR /&gt;There are ways to encode information in a format where the "eye" needs less support from the brain - as one can learn from&amp;nbsp;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/494"&gt;@XanGregg&lt;/a&gt;&amp;nbsp;:&lt;BR /&gt;&lt;LI-MESSAGE title="Plenary: All Graphs Are Wrong, but Some Are Useful - Xan Gregg" uid="23154" url="https://community.jmp.com/t5/Discovery-Summit-2015/Plenary-All-Graphs-Are-Wrong-but-Some-Are-Useful-Xan-Gregg/m-p/23154#U23154" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thinking along this line ...&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A Click on a bracket to highlight the If statement&lt;/STRONG&gt;&lt;FONT color="#999999"&gt; is very useful&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#999999"&gt;- but it would be great if the shading of the included text was not uniform (like in the picture on the left) - but&lt;/FONT&gt; &lt;STRONG&gt;in a&amp;nbsp;meaningful&amp;nbsp;way&lt;/STRONG&gt; (like in the picture on the right).&lt;/P&gt;&lt;P&gt;Jmp has all the information that is needed (it uses it to adjust the indentation) - why not use it for the shading?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's clear that there is NO additional information in the picture on the right which cannot be deduced from the indentation on the left.&lt;/P&gt;&lt;P&gt;And the indentation can even show more: the complete hierarchy of the complex code structure at a single glance. Yes.&lt;/P&gt;&lt;P&gt;But the right image looks quite convinding, right?&lt;BR /&gt;&lt;BR /&gt;edit: &lt;A href="https://community.jmp.com/t5/JMP-Wish-List/optimized-syntax-highlighting-in-JSL-editor/idi-p/573533" target="_self"&gt;link to the wish&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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="hogi_3-1669376512364.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47625i05E89AA3D2CB1B83/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_3-1669376512364.png" alt="hogi_3-1669376512364.png" /&gt;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_4-1669376548370.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47626i08FECD4382BE43BA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_4-1669376548370.png" alt="hogi_4-1669376548370.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 16:50:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573510#M78251</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-06-28T16:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573514#M78253</link>
      <description>&lt;P&gt;I like your thinking on this, and other thoughts you are having on improvements to JMP and JSL.....I suggest you add these to the JMP Wish List,.&amp;nbsp; That will get your input to the individuals who can actually make the changes.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2022 12:15:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573514#M78253</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-11-25T12:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573541#M78254</link>
      <description>&lt;P&gt;thank you for your support :)&lt;/img&gt;&lt;BR /&gt;&lt;BR /&gt;here is the wish:&lt;BR /&gt;&lt;LI-MESSAGE title="optimized syntax highlighting in JSL editor" uid="573533" url="https://community.jmp.com/t5/JMP-Wish-List/optimized-syntax-highlighting-in-JSL-editor/m-p/573533#U573533" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2023 16:51:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573541#M78254</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-06-28T16:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573544#M78255</link>
      <description>&lt;P&gt;JMP should hire you into a product quality role! Love it!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2022 14:15:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573544#M78255</guid>
      <dc:creator>pauldeen</dc:creator>
      <dc:date>2022-11-25T14:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573771#M78273</link>
      <description>&lt;P&gt;My solution to this is to put important commas at the level of the enclosing fence.&amp;nbsp; Here is an example -- notice that the commas separating the IF blocks are at the level of the IF statement, and the same for TRY&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(
	If( Contains( dt &amp;lt;&amp;lt; Get Column Names, As Name( "height" ) ),
		mean = Col Mean( dt:height );
		max = Col Max( dt:height );
		min = Col Min( dt:height );
		std dev = Col Std Dev( dt:height );
		Write( "\!NSome stats on :HEIGHT:",
			"\!NMin: ", min,
			"\!NMax: ", max,
			"\!NMean: ", mean,
			"\!NStd Dev: ", std dev
		)
	,
		Contains( dt &amp;lt;&amp;lt; Get Column Names, As Name( "weight" ) ),
		mean = Col Mean( dt:weight );
		max = Col Max( dt:weight );
		min = Col Min( dt:weight );
		std dev = Col Std Dev( dt:weight );
		Write( "\!NSome stats on :WEIGHT:",
			"\!NMin: ", min,
			"\!NMax: ", max,
			"\!NMean: ", mean,
			"\!NStd Dev: ", std dev
		)
	,
		Contains( dt &amp;lt;&amp;lt; Get Column Names, As Name( "age" ) ),
		mean = Col Mean( dt:age );
		max = Col Max( dt:age );
		min = Col Min( dt:age );
		std dev = Col Std Dev( dt:age );
		Write( "\!NSome stats on :AGE:",
			"\!NMin: ", min,
			"\!NMax: ", max,
			"\!NMean: ", mean,
			"\!NStd Dev: ", std dev
		)
	,
		Print( "Cannot find columns 'height', 'weight', or 'age'" )
	)
,
	Print( "mistakes were made" )
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 27 Nov 2022 05:55:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573771#M78273</guid>
      <dc:creator>ErraticAttack</dc:creator>
      <dc:date>2022-11-27T05:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573774#M78274</link>
      <description>&lt;P&gt;I use a bit similar style as &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26363"&gt;@ErraticAttack&lt;/a&gt; but I separate conditions to same line as , and might even comment else and catch if the blocks are long&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Current Data Table();

Try(
	If(Is Empty(dt),
		print("no table found");
	, N Rows(dt) == 0,
		print("table has no data");
	, N Rows(dt) &amp;lt;= 10,
		print("not enough data");
	, // else
		print("ok")
	);		
, // catch
	show(exception_msg);
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I &lt;STRONG&gt;try&lt;/STRONG&gt; to avoid using jsl re-formatting after my scripts gets long /complicated enough as I usually have to clean-up after using it. Even if reformat was as flexible as I would need it to be, I think I wouldn't bother configuring it properly...&lt;/P&gt;</description>
      <pubDate>Sun, 27 Nov 2022 07:56:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573774#M78274</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-11-27T07:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573776#M78276</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;configuring [re-formatting] properly...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;is there a way to configure&amp;nbsp;re-formatting?&lt;BR /&gt;&lt;BR /&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>Sun, 27 Nov 2022 12:32:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573776#M78276</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2022-11-27T12:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573777#M78277</link>
      <description>&lt;P&gt;Not to my knowledge. Currently the few changes you can are found from preferences Script Editor page.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also writing customizable auto-formatter isn't the most simple task (at least I would think so) and I'm not even sure if it is a good idea. I think opinionated auto-formatters are more common and most likely better than fully customizable ones. But JSL has no style guides to follow, so there is no &lt;STRONG&gt;common&lt;/STRONG&gt; opinion to base the auto-formatter on (JSL is very small language).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a video regarding black auto-formatter for Python &lt;A href="https://youtu.be/esZLCuWs_2Y" target="_blank" rel="noopener"&gt; Łukasz Langa - Life Is Better Painted Black, or: How to Stop Worrying and Embrace Auto-Formatting (youtube.com)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Nov 2022 10:52:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573777#M78277</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-11-27T10:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573890#M78290</link>
      <description>&lt;P&gt;I agree with &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;, I avoid using re-format.&amp;nbsp; It's my job as a programmer to have a clear style guide and enforce it as I write the code.&lt;/P&gt;
&lt;P&gt;Annotations such as&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;, // else&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;can help give a visual guide when there are a large number of lines of code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I too, think aligning the comma with the main if statement is the preferable style.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2022 08:30:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573890#M78290</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2022-11-28T08:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/574860#M78351</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/26800"&gt;@hogi&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;This is not an exact answer to your specific question. But i think this jsl extension for visual studio provides a better scripting experience in general.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://marketplace.visualstudio.com/items?itemName=VinceFaller.jmp-scripting" target="_blank"&gt;https://marketplace.visualstudio.com/items?itemName=VinceFaller.jmp-scripting&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 10:20:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/574860#M78351</guid>
      <dc:creator>ron_horne</dc:creator>
      <dc:date>2022-11-30T10:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/576995#M78461</link>
      <description>&lt;P&gt;Oh no - once again, after some copy &amp;amp; paste and re-arrangement of my code it behaves as if there was a wrong comma somewhere in an if statement&lt;/P&gt;&lt;P&gt;&amp;nbsp;- and I wished there was a &lt;A href="https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573510/highlight/true#M78251" target="_self"&gt;highlight function&amp;nbsp;&lt;/A&gt;implemented already in Jmp17 :)&lt;/img&gt;&lt;/P&gt;&lt;P&gt;Hm, not yet ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I went back to the suggestions in the posts and searched for some help.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;While reading the suggestions&lt;EM&gt; the first time&lt;/EM&gt; I thought: sounds good, many of them will help me when I have the next problem.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, when searching for the erroneously placed comma, actually it was &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;'s&amp;nbsp; &lt;A href="https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573295/highlight/true#M78228" target="_self"&gt;suggestion&lt;/A&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;which helped me to find it:&lt;BR /&gt;Click on &lt;STRONG&gt;reformat script&amp;nbsp;&lt;/STRONG&gt;and check where the indentation doesn't fit to the expected one.&lt;/P&gt;&lt;P&gt;Quite simple - and as expected.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;On the other hand, while searching again and again for the wrong comma, the other suggestions&amp;nbsp;read a bit like&lt;/P&gt;&lt;P&gt;"&lt;EM&gt;there is a comma where it should not be? you have to find it and correct it&lt;/EM&gt;".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To combine both approaches ,to write your code&lt;/P&gt;&lt;P&gt;1) in a readable way&lt;BR /&gt;2)&amp;nbsp; such that&amp;nbsp;&lt;STRONG&gt;reformat script&amp;nbsp;&lt;/STRONG&gt;doesn't change the formatting.&lt;/P&gt;&lt;P&gt;One could put an &lt;STRONG&gt;&lt;EM&gt;empty line&lt;/EM&gt;&lt;/STRONG&gt; in front of the commas in the &lt;STRONG&gt;if&lt;/STRONG&gt; statements. This will prevent &lt;STRONG&gt;reformat script&amp;nbsp;&lt;/STRONG&gt;from moving the commas to the end of the previous line.&amp;nbsp;Unfortunately, it will also shift the code after the commas to the next line, just leaving the commas there - which makes the code a bit "wide-meshed" and difficult to read. Hm.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
If(
	Is Empty( dt ),
		Print( "no table found" );
		
,
	N Rows( dt ) == 0,
		Print( "table has no data" );
		
, // else
	Print( "ok" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Try on your own:&lt;/STRONG&gt;&lt;EM&gt; Wherer is the erroneously placed comma&lt;BR /&gt;&lt;/EM&gt;code as it was&amp;nbsp;provided by&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/573771/highlight/true#M78273" target="_self"&gt;ErraticAttack&lt;/A&gt;, but with a comma where there should be a semicolon:&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here( 1 );
dt = Current Data Table();

Try(
	If( Contains( dt &amp;lt;&amp;lt; Get Column Names, As Name( "height" ) ),
		mean = Col Mean( dt:height );
		max = Col Max( dt:height );
		min = Col Min( dt:height );
		std dev = Col Std Dev( dt:height ),
		Write( "\!NSome stats on :HEIGHT:",
			"\!NMin: ", min,
			"\!NMax: ", max,
			"\!NMean: ", mean,
			"\!NStd Dev: ", std dev
		)
	,
		Contains( dt &amp;lt;&amp;lt; Get Column Names, As Name( "weight" ) ),
		mean = Col Mean( dt:weight );
		max = Col Max( dt:weight );
		min = Col Min( dt:weight );
		std dev = Col Std Dev( dt:weight );
		Write( "\!NSome stats on :WEIGHT:",
			"\!NMin: ", min,
			"\!NMax: ", max,
			"\!NMean: ", mean,
			"\!NStd Dev: ", std dev
		)
	,
		Contains( dt &amp;lt;&amp;lt; Get Column Names, As Name( "age" ) ),
		mean = Col Mean( dt:age );
		max = Col Max( dt:age );
		min = Col Min( dt:age );
		std dev = Col Std Dev( dt:age );
		Write( "\!NSome stats on :AGE:",
			"\!NMin: ", min,
			"\!NMax: ", max,
			"\!NMean: ", mean,
			"\!NStd Dev: ", std dev
		)
	,
		Print( "Cannot find columns 'height', 'weight', or 'age'" )
	)
,
	Print( "mistakes were made" )
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;after reformat script:&lt;BR /&gt;-&amp;nbsp; the wrong comma is easily visible because indentation changed completely.&lt;BR /&gt;-&amp;nbsp; (even without a wrong comma) all commas are moved to the end of the previous line -&amp;nbsp; which makes it more difficult to analyze the structure&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();

Try(
	If(
		Contains( dt &amp;lt;&amp;lt; Get Column Names, As Name( "height" ) ),
			mean = Col Mean( dt:height );
			max = Col Max( dt:height );
			min = Col Min( dt:height );
			std dev = Col Std Dev( dt:height );, // &amp;lt;- wrong comma
		Write( //&amp;lt;- "wrong" indentation gives the hint
			"\!NSome stats on :HEIGHT:",
			"\!NMin: ",
			min,
			"\!NMax: ",
			max,
			"\!NMean: ",
			mean,
			"\!NStd Dev: ",
			std dev
		), Contains( dt &amp;lt;&amp;lt; Get Column Names, As Name( "weight" ) ),
		mean = Col Mean( dt:weight );
		max = Col Max( dt:weight );
		min = Col Min( dt:weight );
		std dev = Col Std Dev( dt:weight );
		Write(
			"\!NSome stats on :WEIGHT:",
			"\!NMin: ",
			min,
			"\!NMax: ",
			max,
			"\!NMean: ",
			mean,
			"\!NStd Dev: ",
			std dev
		);, Contains( dt &amp;lt;&amp;lt; Get Column Names, As Name( "age" ) ),
		mean = Col Mean( dt:age );
		max = Col Max( dt:age );
		min = Col Min( dt:age );
		std dev = Col Std Dev( dt:age );
		Write(
			"\!NSome stats on :AGE:",
			"\!NMin: ",
			min,
			"\!NMax: ",
			max,
			"\!NMean: ",
			mean,
			"\!NStd Dev: ",
			std dev
		);, Print( "Cannot find columns 'height', 'weight', or 'age'" )
	)
,
	Print( "mistakes were made" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;/LI-SPOILER&gt;</description>
      <pubDate>Mon, 05 Dec 2022 14:57:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/576995#M78461</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2022-12-05T14:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/577149#M78473</link>
      <description>&lt;P&gt;&amp;nbsp;Pasting the If() statement into the Formula editor helps spot it pretty quickly. &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022-12-04_15-54-03.773.png" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/47921iBC52BB8C3ACFF3C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022-12-04_15-54-03.773.png" alt="2022-12-04_15-54-03.773.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Dec 2022 20:54:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/577149#M78473</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2022-12-04T20:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/577344#M78489</link>
      <description>&lt;P&gt;cool, very convenient :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 14:59:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/577344#M78489</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2022-12-05T14:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/737972#M91924</link>
      <description>&lt;P&gt;a nice example what can go wrong:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;x= if(&lt;BR /&gt;// 1st test&lt;BR /&gt;&lt;BR /&gt;    1==3,
	1
, // 2nd test
	1==5,
	2,
, // others
	3
)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;after executing the code, x= ...&lt;/P&gt;&lt;LI-SPOILER&gt;hint:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1711130931064.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/62541i45A8582E510E96F5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1711130931064.png" alt="hogi_0-1711130931064.png" /&gt;&lt;/span&gt;&lt;P&gt;&lt;BR /&gt;... no error message?&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Dec 2024 19:58:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/737972#M91924</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-29T19:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: JSL: if - else -&gt; find the commas?</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/824269#M100370</link>
      <description>&lt;P&gt;Guys, this is almost perfect:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1734536373634.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/71384iFA20C0FD17C2342A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1734536373634.png" alt="hogi_0-1734536373634.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/Discussions/If-statement-comma/m-p/824212/highlight/true#M100363" target="_blank" rel="noopener"&gt;https://community.jmp.com/t5/Discussions/If-statement-comma/m-p/824212/highlight/true#M100363&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;nice workaround&lt;BR /&gt;... till &lt;LI-MESSAGE title="🙏 optimized syntax highlighting in JSL editor" uid="573533" url="https://community.jmp.com/t5/JMP-Wish-List/optimized-syntax-highlighting-in-JSL-editor/m-p/573533#U573533" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-idea-thread lia-fa-icon lia-fa-idea lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;gets available.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Dec 2024 20:00:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-if-else-gt-find-the-commas/m-p/824269#M100370</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-12-29T20:00:53Z</dc:date>
    </item>
  </channel>
</rss>

