Code region compiler directive
|Enabled for||Public preview||General availability|
|Admins, makers, or analysts, automatically||Aug 1, 2020||Oct 1, 2020|
Use code regions to structure related code, add documentation of code sections, and expand or collapse these for fast navigation in your code with easy outlining of the code.
Directives is a new construct in the AL language that specifies how the AL compiler treats an enclosed section of code. The same concept is known in other languages. The specific directive instructions must be supported by the compiler—you cannot create custom preprocessing instructions.
We now introduce two new directives for enclosing a section of code and define it as a region.
A #region block must be terminated with an #endregion directive as shown in the following examples.
Example of defining regions in a code unit.
Example of collapsing regions.
Thank you for your idea
Thank you for submitting this idea. We listened to your idea, along with comments and votes, to help us decide what to add to our product roadmap.