deploy: 9e06f72056
This commit is contained in:
parent
de09820554
commit
e4f08bf9a7
187 changed files with 6620 additions and 6342 deletions
|
|
@ -5,16 +5,16 @@
|
|||
<meta name=generator content="Hugo 0.92.1">
|
||||
<meta name=description content>
|
||||
<title>Indentation :: AL Guidelines</title>
|
||||
<link href=/css/nucleus.css?1644506470 rel=stylesheet>
|
||||
<link href=/css/fontawesome-all.min.css?1644506470 rel=stylesheet>
|
||||
<link href=/css/featherlight.min.css?1644506470 rel=stylesheet>
|
||||
<link href=/css/perfect-scrollbar.min.css?1644506470 rel=stylesheet>
|
||||
<link href=/css/auto-complete.css?1644506470 rel=stylesheet>
|
||||
<link href=/css/theme.css?1644506470 rel=stylesheet>
|
||||
<link href=/css/theme-blue.css?1644506470 rel=stylesheet>
|
||||
<link href=/css/variant.css?1644506470 rel=stylesheet>
|
||||
<link href=/css/print.css?1644506470 rel=stylesheet media=print>
|
||||
<script src=/js/jquery.min.js?1644506470></script>
|
||||
<link href=/css/nucleus.css?1644600600 rel=stylesheet>
|
||||
<link href=/css/fontawesome-all.min.css?1644600600 rel=stylesheet>
|
||||
<link href=/css/featherlight.min.css?1644600600 rel=stylesheet>
|
||||
<link href=/css/perfect-scrollbar.min.css?1644600600 rel=stylesheet>
|
||||
<link href=/css/auto-complete.css?1644600600 rel=stylesheet>
|
||||
<link href=/css/theme.css?1644600600 rel=stylesheet>
|
||||
<link href=/css/theme-blue.css?1644600600 rel=stylesheet>
|
||||
<link href=/css/variant.css?1644600600 rel=stylesheet>
|
||||
<link href=/css/print.css?1644600600 rel=stylesheet media=print>
|
||||
<script src=/js/jquery.min.js?1644600600></script>
|
||||
<style>:root #header+#content>#left>#rlblock_left{display:none!important}</style>
|
||||
</head>
|
||||
<body data-url=/navpatterns/3-cal-coding-guidelines/readability/indentation/>
|
||||
|
|
@ -32,9 +32,9 @@ ALGuidelines.Dev
|
|||
<input data-search-input id=search-by type=search placeholder=Search...>
|
||||
<span data-search-clear><i class="fas fa-times"></i></span>
|
||||
</div>
|
||||
<script src=/js/lunr.min.js?1644506470></script>
|
||||
<script src=/js/auto-complete.js?1644506470></script>
|
||||
<script src=/js/search.js?1644506470></script>
|
||||
<script src=/js/lunr.min.js?1644600600></script>
|
||||
<script src=/js/auto-complete.js?1644600600></script>
|
||||
<script src=/js/search.js?1644600600></script>
|
||||
</div>
|
||||
<div class=highlightable>
|
||||
<ul class=topics>
|
||||
|
|
@ -255,72 +255,59 @@ ALGuidelines.Dev
|
|||
</div>
|
||||
<main id=body-inner>
|
||||
<h1>Indentation</h1>
|
||||
<p>In general, use an indentation of two space characters. Logical expressions in the IF, WHILE, and UNTIL parts are indented at least 3, 6, and 6 spaces respectively.
|
||||
Bad code</p>
|
||||
<pre><code>IF GLSetup."Unrealized VAT" OR
|
||||
(GLSetup."Prepayment Unrealized VAT" AND NewCVLedgEntryBuf.Prepayment)
|
||||
</code></pre>
|
||||
<p>Good code</p>
|
||||
<pre><code>IF GLSetup."Unrealized VAT" OR
|
||||
(GLSetup."Prepayment Unrealized VAT" AND NewCVLedgEntryBuf.Prepayment)
|
||||
</code></pre>
|
||||
<p>In general, use an indentation of two space characters. Logical expressions in the IF, WHILE, and UNTIL parts are indented at least 3, 6, and 6 spaces respectively.</p>
|
||||
<p>Bad code</p>
|
||||
<pre><code>IF GenJnlLine."Account No." <\> ICPartner.Code THEN
|
||||
ICPartner.GET("Account No.");
|
||||
IF GenJnlLine.Amount \> 0 THEN BEGIN
|
||||
...
|
||||
</code></pre>
|
||||
<p>Good code</p>
|
||||
<pre><code>IF GenJnlLine."Account No." <\> ICPartner.Code THEN
|
||||
ICPartner.GET("Account No.");
|
||||
IF GenJnlLine.Amount \> 0 THEN BEGIN
|
||||
...
|
||||
</code></pre>
|
||||
<p>Bad code</p>
|
||||
<pre><code>Dialog.OPEN(WindowTxt +
|
||||
'@1@@@@@@@@@@@@@@@@@@@@@@@');
|
||||
</code></pre>
|
||||
<p>Good code</p>
|
||||
<pre><code>Dialog.OPEN(
|
||||
WindowTxt +
|
||||
'@1@@@@@@@@@@@@@@@@@@@@@@@');
|
||||
</code></pre>
|
||||
<p>Bad code</p>
|
||||
<pre><code>TempOldCustLedgEntry.DELETE;
|
||||
// Find the next old entry for application of the new entry
|
||||
</code></pre>
|
||||
<p>Good code</p>
|
||||
<pre><code>TempOldCustLedgEntry.DELETE;
|
||||
// Find the next old entry for application of the new entry
|
||||
</code></pre>
|
||||
<p>Bad code</p>
|
||||
<pre><code>IF NOT ("Applies-to Doc. Type" IN
|
||||
\["Applies-to Doc. Type"::Receipt,
|
||||
"Applies-to Doc. Type"::"Return Shipment"\])
|
||||
</code></pre>
|
||||
<p>Good code</p>
|
||||
<pre><code>IF NOT ("Applies-to Doc. Type" IN
|
||||
\["Applies-to Doc. Type"::Receipt,
|
||||
"Applies-to Doc. Type"::"Return Shipment"\])
|
||||
</code></pre>
|
||||
<p>Bad code</p>
|
||||
<pre><code>WHILE (RemAmt \> 0) OR
|
||||
(RemAmtLCY \> 0)
|
||||
DO
|
||||
</code></pre>
|
||||
<p>Good code</p>
|
||||
<pre><code>WHILE (RemAmt \> 0) OR
|
||||
(RemAmtLCY \> 0)
|
||||
DO
|
||||
</code></pre>
|
||||
<p>Bad code</p>
|
||||
<pre><code>UNTIL (RemAmt \> 0) AND
|
||||
(RemAmtLCY \> 0);
|
||||
</code></pre>
|
||||
<p>Good code</p>
|
||||
<pre><code>UNTIL (RemAmt \> 0) AND
|
||||
(RemAmtLCY \> 0)
|
||||
</code></pre>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al><span style=color:#66d9ef>IF</span> GLSetup<span style=color:#f92672>.</span>"Unrealized VAT" <span style=color:#f92672>OR</span>
|
||||
<span style=color:#f92672>(</span>GLSetup<span style=color:#f92672>.</span>"Prepayment Unrealized VAT" <span style=color:#f92672>AND</span> NewCVLedgEntryBuf<span style=color:#f92672>.</span>Prepayment<span style=color:#f92672>)
|
||||
</span></code></pre></div><p>Good code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al><span style=color:#66d9ef>IF</span> GLSetup<span style=color:#f92672>.</span>"Unrealized VAT" <span style=color:#f92672>OR</span>
|
||||
<span style=color:#f92672>(</span>GLSetup<span style=color:#f92672>.</span>"Prepayment Unrealized VAT" <span style=color:#f92672>AND</span> NewCVLedgEntryBuf<span style=color:#f92672>.</span>Prepayment<span style=color:#f92672>)
|
||||
</span></code></pre></div><p>Bad code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al><span style=color:#66d9ef>IF</span> GenJnlLine<span style=color:#f92672>.</span>"Account No." <> ICPartner<span style=color:#f92672>.</span><span style=color:#66d9ef>Code</span> <span style=color:#66d9ef>THEN</span>
|
||||
ICPartner<span style=color:#f92672>.</span>GET<span style=color:#f92672>(</span>"Account No."<span style=color:#f92672>)</span>;
|
||||
<span style=color:#66d9ef>IF</span> GenJnlLine<span style=color:#f92672>.</span>Amount \> <span style=color:#ae81ff>0</span> <span style=color:#66d9ef>THEN</span> <span style=color:#66d9ef>BEGIN</span>
|
||||
<span style=color:#f92672>...
|
||||
</span></code></pre></div><p>Good code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al><span style=color:#66d9ef>IF</span> GenJnlLine<span style=color:#f92672>.</span>"Account No." <> ICPartner<span style=color:#f92672>.</span><span style=color:#66d9ef>Code</span> <span style=color:#66d9ef>THEN</span>
|
||||
ICPartner<span style=color:#f92672>.</span>GET<span style=color:#f92672>(</span>"Account No."<span style=color:#f92672>)</span>;
|
||||
<span style=color:#66d9ef>IF</span> GenJnlLine<span style=color:#f92672>.</span>Amount > <span style=color:#ae81ff>0</span> <span style=color:#66d9ef>THEN</span> <span style=color:#66d9ef>BEGIN</span>
|
||||
<span style=color:#f92672>...
|
||||
</span></code></pre></div><p>Bad code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al><span style=color:#66d9ef>Dialog</span><span style=color:#f92672>.</span>OPEN<span style=color:#f92672>(</span>WindowTxt +
|
||||
<span style=color:#e6db74>'@1@@@@@@@@@@@@@@@@@@@@@@@'</span><span style=color:#f92672>)</span>;
|
||||
</code></pre></div><p>Good code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al><span style=color:#66d9ef>Dialog</span><span style=color:#f92672>.</span>OPEN<span style=color:#f92672>(
|
||||
</span><span style=color:#f92672> </span>WindowTxt +
|
||||
<span style=color:#e6db74>'@1@@@@@@@@@@@@@@@@@@@@@@@'</span><span style=color:#f92672>)</span>;
|
||||
</code></pre></div><p>Bad code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al>TempOldCustLedgEntry<span style=color:#f92672>.</span>DELETE;
|
||||
<span style=color:#75715e>// Find the next old entry for application of the new entry
|
||||
</span></code></pre></div><p>Good code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al>TempOldCustLedgEntry<span style=color:#f92672>.</span>DELETE;
|
||||
<span style=color:#75715e>// Find the next old entry for application of the new entry
|
||||
</span></code></pre></div><p>Bad code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al><span style=color:#66d9ef>IF</span> <span style=color:#f92672>NOT</span> <span style=color:#f92672>(</span>"Applies-to Doc. Type" <span style=color:#66d9ef>IN</span>
|
||||
["Applies-to Doc. Type"::Receipt,
|
||||
"Applies-to Doc. Type"::"Return Shipment"]<span style=color:#f92672>)
|
||||
</span></code></pre></div><p>Good code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al><span style=color:#66d9ef>IF</span> <span style=color:#f92672>NOT</span> <span style=color:#f92672>(</span>"Applies-to Doc. Type" <span style=color:#66d9ef>IN</span>
|
||||
["Applies-to Doc. Type"::Receipt,
|
||||
"Applies-to Doc. Type"::"Return Shipment"]<span style=color:#f92672>)
|
||||
</span></code></pre></div><p>Bad code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al><span style=color:#66d9ef>WHILE</span> <span style=color:#f92672>(</span>RemAmt > <span style=color:#ae81ff>0</span><span style=color:#f92672>) </span><span style=color:#f92672>OR</span>
|
||||
<span style=color:#f92672>(</span>RemAmtLCY > <span style=color:#ae81ff>0</span><span style=color:#f92672>)
|
||||
</span><span style=color:#f92672></span><span style=color:#66d9ef>DO</span>
|
||||
</code></pre></div><p>Good code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al><span style=color:#66d9ef>WHILE</span> <span style=color:#f92672>(</span>RemAmt > <span style=color:#ae81ff>0</span><span style=color:#f92672>) </span><span style=color:#f92672>OR</span>
|
||||
<span style=color:#f92672>(</span>RemAmtLCY > <span style=color:#ae81ff>0</span><span style=color:#f92672>)
|
||||
</span><span style=color:#f92672></span><span style=color:#66d9ef>DO</span>
|
||||
</code></pre></div><p>Bad code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al><span style=color:#66d9ef>UNTIL</span> <span style=color:#f92672>(</span>RemAmt > <span style=color:#ae81ff>0</span><span style=color:#f92672>) </span><span style=color:#f92672>AND</span>
|
||||
<span style=color:#f92672>(</span>RemAmtLCY > <span style=color:#ae81ff>0</span><span style=color:#f92672>)</span>;
|
||||
</code></pre></div><p>Good code</p>
|
||||
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-al data-lang=al><span style=color:#66d9ef>UNTIL</span> <span style=color:#f92672>(</span>RemAmt > <span style=color:#ae81ff>0</span><span style=color:#f92672>) </span><span style=color:#f92672>AND</span>
|
||||
<span style=color:#f92672>(</span>RemAmtLCY > <span style=color:#ae81ff>0</span><span style=color:#f92672>)
|
||||
</span></code></pre></div>
|
||||
<footer class=footline>
|
||||
</footer>
|
||||
</main>
|
||||
|
|
@ -333,12 +320,12 @@ DO
|
|||
<div style=left:-1000px;overflow:scroll;position:absolute;top:-1000px;border:none;box-sizing:content-box;height:200px;margin:0;padding:0;width:200px>
|
||||
<div style=border:none;box-sizing:content-box;height:200px;margin:0;padding:0;width:200px></div>
|
||||
</div>
|
||||
<script src=/js/clipboard.min.js?1644506470></script>
|
||||
<script src=/js/perfect-scrollbar.min.js?1644506470></script>
|
||||
<script src=/js/perfect-scrollbar.jquery.min.js?1644506470></script>
|
||||
<script src=/js/jquery.svg.pan.zoom.js?1644506470></script>
|
||||
<script src=/js/featherlight.min.js?1644506470></script>
|
||||
<script src=/js/modernizr.custom-3.6.0.js?1644506470></script>
|
||||
<script src=/js/relearn.js?1644506470></script>
|
||||
<script src=/js/clipboard.min.js?1644600600></script>
|
||||
<script src=/js/perfect-scrollbar.min.js?1644600600></script>
|
||||
<script src=/js/perfect-scrollbar.jquery.min.js?1644600600></script>
|
||||
<script src=/js/jquery.svg.pan.zoom.js?1644600600></script>
|
||||
<script src=/js/featherlight.min.js?1644600600></script>
|
||||
<script src=/js/modernizr.custom-3.6.0.js?1644600600></script>
|
||||
<script src=/js/relearn.js?1644600600></script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue