This commit is contained in:
TheDoubleH 2022-02-11 17:30:04 +00:00
parent de09820554
commit e4f08bf9a7
187 changed files with 6620 additions and 6342 deletions

View file

@ -5,16 +5,16 @@
<meta name=generator content="Hugo 0.92.1">
<meta name=description content>
<title>Variable Naming :: 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?1644600601 rel=stylesheet>
<link href=/css/fontawesome-all.min.css?1644600601 rel=stylesheet>
<link href=/css/featherlight.min.css?1644600601 rel=stylesheet>
<link href=/css/perfect-scrollbar.min.css?1644600601 rel=stylesheet>
<link href=/css/auto-complete.css?1644600601 rel=stylesheet>
<link href=/css/theme.css?1644600601 rel=stylesheet>
<link href=/css/theme-blue.css?1644600601 rel=stylesheet>
<link href=/css/variant.css?1644600601 rel=stylesheet>
<link href=/css/print.css?1644600601 rel=stylesheet media=print>
<script src=/js/jquery.min.js?1644600601></script>
<style>:root #header+#content>#left>#rlblock_left{display:none!important}</style>
</head>
<body data-url=/navpatterns/3-cal-coding-guidelines/readability/variable-naming/>
@ -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?1644600601></script>
<script src=/js/auto-complete.js?1644600601></script>
<script src=/js/search.js?1644600601></script>
</div>
<div class=highlightable>
<ul class=topics>
@ -258,47 +258,42 @@ ALGuidelines.Dev
<p>Variables that refer to a C/AL object must contain the objects name, abbreviated where necessary.</p>
<p>A variable must begin with a capital letter.</p>
<p>Blanks, periods, and other characters (such as parentheses) that would make quotation marks around a variable necessary must be omitted.</p>
<p>If a variable is a compound of two or more words or abbreviations, each word or abbreviation should begin with a capital letter.
Bad code</p>
<pre><code>...
WIPBuffer@1002 : Record 1018
...
OBJECT Table Job WIP Buffer
</code></pre>
<p>Good code</p>
<pre><code>...
JobWIPBuffer@1002 : Record 1018
...
OBJECT Table Job WIP Buffer
</code></pre>
<p>If a variable is a compound of two or more words or abbreviations, each word or abbreviation should begin with a capital letter.</p>
<p>Bad code</p>
<pre><code>...
Postline@1004 : Codeunit 12;
...
OBJECT Codeunit Gen. Jnl.-Post Line
</code></pre>
<p>Good code</p>
<pre><code>...
GenJnlPostLine@1004 : Codeunit 12;
...
OBJECT Codeunit Gen. Jnl.-Post Line
</code></pre>
<p>Bad code</p>
<pre><code>LOCAL PROCEDURE HandleCustDebitCredit@17(...;&quot;Amount (LCY)&quot;@1001 : Decimal;...);
BEGIN
IF ((... (&quot;Amount (LCY)&quot; \&gt; 0)) ...) OR
((... (&quot;Amount (LCY)&quot; &lt; 0)) ...)
THEN BEGIN
...
</code></pre>
<p>Good code</p>
<pre><code>LOCAL PROCEDURE HandleCustDebitCredit@17(...;AmountLCY@1001 : Decimal;...);
BEGIN
IF ((... (AmountLCY \&gt; 0)) ...) OR
((... (AmountLCY &lt; 0)) ...)
THEN BEGIN
...
</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:#f92672>...
</span><span style=color:#f92672> </span>WIPBuffer@<span style=color:#ae81ff>1002</span> : <span style=color:#66d9ef>Record</span> <span style=color:#ae81ff>1018</span>
<span style=color:#f92672>...
</span><span style=color:#f92672></span>OBJECT <span style=color:#66d9ef>Table</span> Job WIP Buffer
</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:#f92672>...
</span><span style=color:#f92672> </span>JobWIPBuffer@<span style=color:#ae81ff>1002</span> : <span style=color:#66d9ef>Record</span> <span style=color:#ae81ff>1018</span>
<span style=color:#f92672>...
</span><span style=color:#f92672></span>OBJECT <span style=color:#66d9ef>Table</span> Job WIP Buffer
</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:#f92672>...
</span><span style=color:#f92672> </span>Postline@<span style=color:#ae81ff>1004</span> : <span style=color:#66d9ef>Codeunit</span> <span style=color:#ae81ff>12</span>;
<span style=color:#f92672>...
</span><span style=color:#f92672></span>OBJECT <span style=color:#66d9ef>Codeunit</span> Gen<span style=color:#f92672>. </span>Jnl<span style=color:#f92672>.</span>-Post Line
</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:#f92672>...
</span><span style=color:#f92672> </span>GenJnlPostLine@<span style=color:#ae81ff>1004</span> : <span style=color:#66d9ef>Codeunit</span> <span style=color:#ae81ff>12</span>;
<span style=color:#f92672>...
</span><span style=color:#f92672></span>OBJECT <span style=color:#66d9ef>Codeunit</span> Gen<span style=color:#f92672>. </span>Jnl<span style=color:#f92672>.</span>-Post Line
</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>LOCAL</span> <span style=color:#66d9ef>PROCEDURE</span> HandleCustDebitCredit@<span style=color:#ae81ff>17</span><span style=color:#f92672>(...</span>;&#34;Amount (LCY)&#34;@<span style=color:#ae81ff>1001</span> : <span style=color:#66d9ef>Decimal</span>;<span style=color:#f92672>...)</span>;
<span style=color:#66d9ef>BEGIN</span>
<span style=color:#66d9ef>IF</span> <span style=color:#f92672>((... (</span>&#34;Amount (LCY)&#34; \&gt; <span style=color:#ae81ff>0</span><span style=color:#f92672>)) ...) </span><span style=color:#f92672>OR</span>
<span style=color:#f92672>((... (</span>&#34;Amount (LCY)&#34; &lt; <span style=color:#ae81ff>0</span><span style=color:#f92672>)) ...)
</span><span style=color:#f92672> </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>LOCAL</span> <span style=color:#66d9ef>PROCEDURE</span> HandleCustDebitCredit@<span style=color:#ae81ff>17</span><span style=color:#f92672>(...</span>;AmountLCY@<span style=color:#ae81ff>1001</span> : <span style=color:#66d9ef>Decimal</span>;<span style=color:#f92672>...)</span>;
<span style=color:#66d9ef>BEGIN</span>
<span style=color:#66d9ef>IF</span> <span style=color:#f92672>((... (</span>AmountLCY \&gt; <span style=color:#ae81ff>0</span><span style=color:#f92672>)) ...) </span><span style=color:#f92672>OR</span>
<span style=color:#f92672>((... (</span>AmountLCY &lt; <span style=color:#ae81ff>0</span><span style=color:#f92672>)) ...)
</span><span style=color:#f92672> </span><span style=color:#66d9ef>THEN</span> <span style=color:#66d9ef>BEGIN</span>
<span style=color:#f92672>...
</span></code></pre></div>
<footer class=footline>
</footer>
</main>
@ -311,12 +306,12 @@ THEN BEGIN
<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?1644600601></script>
<script src=/js/perfect-scrollbar.min.js?1644600601></script>
<script src=/js/perfect-scrollbar.jquery.min.js?1644600601></script>
<script src=/js/jquery.svg.pan.zoom.js?1644600601></script>
<script src=/js/featherlight.min.js?1644600601></script>
<script src=/js/modernizr.custom-3.6.0.js?1644600601></script>
<script src=/js/relearn.js?1644600601></script>
</body>
</html>