Code design
The C/AL compiler checks our code for programming errors such as missing object references, and BEGIN
/END
or REPEAT
/UNTIL
statements that are wrong.
The Microsoft Dynamics NAV Development Environment has a limited warning mechanism that only checks the C/AL functions that used to be part of the Classic Client, but no longer worked in the three-tier stack. The examples are BEEP
and ENVIRON
:
The code design rules are implemented to add an extra layer of rules that are not enforced by the compiler or generate warnings but when applied, they improve the readability of the code.
Unused Variables |
Every variable that is declared global, local, or as a parameter should be used. Unused variables should always be removed by the developer. |
By Reference |
When assigning a variable as parameter, we have the option to declare the variable as By Reference. When this is applied, changes to the variables also apply to the original, since they share the same memory space. In Microsoft... |