<?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: Reformat Script - Protection some code? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690747#M87668</link>
    <description>&lt;P&gt;You mean: don't select some code around the protection area such that the remaining code gets consistent, then trigger &lt;STRONG&gt;Reformat Script&lt;/STRONG&gt;?&lt;BR /&gt;Unfortunately, doesn't seem to work :(&lt;/img&gt;&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_1-1698310104624.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57987i752E0FF05158A004/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1698310104624.png" alt="hogi_1-1698310104624.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2023 09:20:42 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2023-10-26T09:20:42Z</dc:date>
    <item>
      <title>Reformat Script - Protect some code?</title>
      <link>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690720#M87665</link>
      <description>&lt;P&gt;Reformat Script in JSL Editor is very helpful to get the code with a formatted structure.&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_0-1698308604175.png" style="width: 131px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57982i636ED29CCC3123C6/image-dimensions/131x84?v=v2" width="131" height="84" role="button" title="hogi_0-1698308604175.png" alt="hogi_0-1698308604175.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Often it helps to find bugs in the code and to keep the overview.&lt;/P&gt;&lt;P&gt;But sometimes, it's the opposite.&lt;BR /&gt;Is there a way to protect code in a specific area from being shuffled by &lt;STRONG&gt;Reformat Script&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1698309509307.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57984i6756E2B34D39F4BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1698309509307.png" alt="hogi_0-1698309509307.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; Recode Column(
	dt:name,
	{Map Value(
		_rcOrig,
		{"ALFRED", "A",
		 "ALICE", "A",
		 "AMY", "A",
		 "BARBARA", "A",
		 "CAROL", "A",
		 "CHRIS", "A",
		 "CLAY", "A",
		 "DANNY", "A",
		 "DAVID", "A",
		 "EDWARD", "A",
		 "ELIZABETH", "B",
		 "FREDERICK", "B",
		 "HENRY", "B",
		 "JACLYN", //missing
		 "JAMES", "B",
		 "JANE", "B",
		 "JEFFREY","B",
		 "JOE","B",
		 "JOHN", "B",
		 "JUDY", "B",
		 "KATIE", "B"
		 },
		Unmatched( _rcNow )
	)},
	Update Properties( 1 ),
	Target Column( :name )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 08:51:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690720#M87665</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-26T08:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reformat Script - Protection some code?</title>
      <link>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690741#M87667</link>
      <description>&lt;P&gt;Select only part of your code and then reformat the script&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 08:41:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690741#M87667</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-10-26T08:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reformat Script - Protection some code?</title>
      <link>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690747#M87668</link>
      <description>&lt;P&gt;You mean: don't select some code around the protection area such that the remaining code gets consistent, then trigger &lt;STRONG&gt;Reformat Script&lt;/STRONG&gt;?&lt;BR /&gt;Unfortunately, doesn't seem to work :(&lt;/img&gt;&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_1-1698310104624.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57987i752E0FF05158A004/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_1-1698310104624.png" alt="hogi_1-1698310104624.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 09:20:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690747#M87668</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-26T09:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reformat Script - Protection some code?</title>
      <link>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690782#M87672</link>
      <description>&lt;P&gt;Jarmo's suggestion works well, however one has to reformat syntactically valid JSL&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1698311199471.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57988i515785C1597F1333/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_0-1698311199471.png" alt="txnelson_0-1698311199471.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;results in reformatting only the selected parts of the code&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_1-1698311294967.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57989i6C0DBBE882EEC7A1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="txnelson_1-1698311294967.png" alt="txnelson_1-1698311294967.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 09:08:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690782#M87672</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-26T09:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reformat Script - Protection some code?</title>
      <link>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690789#M87674</link>
      <description>&lt;P&gt;Hm, syntactically valid JSL code -&amp;nbsp;reformat works if I delete the code in the (non-selected)&lt;EM&gt; protection area&lt;/EM&gt;.&lt;BR /&gt;So, the remainder seems to be OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the actual problem is:&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;&lt;EM&gt;two&lt;/EM&gt; &lt;/STRONG&gt;pieces of code - above and below the &lt;EM&gt;protection area&lt;/EM&gt; have to be - separately -&amp;nbsp; syntactically valid JSL code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e. the protection area has to be on highest level - e.g. a whole function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;another example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="hogi_0-1698311869341.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/57990iC232E5C73F74E8A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="hogi_0-1698311869341.png" alt="hogi_0-1698311869341.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 09:21:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690789#M87674</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2023-10-26T09:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Reformat Script - Protection some code?</title>
      <link>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690790#M87675</link>
      <description>&lt;P&gt;Good catch.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is a work around.&amp;nbsp; The&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Advanced=&amp;gt;Comment Block&lt;/P&gt;
&lt;P&gt;does not change the structure of the code, it simply comments out a highlighted section of code.&amp;nbsp; If you Comment Block, then Reformat the JSL and then highlight and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Advanced=?Uncomment Block&lt;/P&gt;
&lt;P&gt;you will achieve your goal&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 09:41:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Reformat-Script-Protect-some-code/m-p/690790#M87675</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-10-26T09:41:11Z</dc:date>
    </item>
  </channel>
</rss>

