Begin-End - Compound Only
Categories:
Created by Microsoft, Described by waldo
Only use begin..end to enclose compound statements.
Example 1
Bad code
if FindSet() then begin
repeat
...
until next() = 0;
end;
Good code
if FindSet() then
repeat
...
until next() = 0;
Example 2
Bad code
if IsAssemblyOutputLine then begin
TestField("Order Line No.", 0);
end;
Good code
if IsAssemblyOutputLine then
TestField("Order Line No.", 0);
Exception
// Except for this case
if X then begin
if Y then
//DO SOMETHING;
end else
(not X)
Tips
The AZ AL Dev Tools/AL Code Outline extension adds two new commands to Visual Studio Code to remove begin..end around single statements.
Remove Begin..End around Single Statements from the Active Editor
: removes begin..end around single statement from the current editorRemove Begin..End around Single Statements from the Active Project
: removes begin..end around single statement from the current project
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified October 4, 2024: Merge pull request #249 from Busschers/ErrorHandling-ListOfReferenceText (5e76983)
by Arend-Jan Kauffmann