From a63b1597d8fe0f12569d121a52e527304120f3cb Mon Sep 17 00:00:00 2001 From: waldo1001 Date: Sat, 11 Dec 2021 08:14:24 +0100 Subject: [PATCH] begin as an 'After Word' --- content/BCBestPractices/Readability/_index.md | 11 +++++++ .../begin-as-an-afterword/index.md | 33 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 content/BCBestPractices/Readability/_index.md create mode 100644 content/BCBestPractices/Readability/begin-as-an-afterword/index.md diff --git a/content/BCBestPractices/Readability/_index.md b/content/BCBestPractices/Readability/_index.md new file mode 100644 index 00000000..f2c4c118 --- /dev/null +++ b/content/BCBestPractices/Readability/_index.md @@ -0,0 +1,11 @@ ++++ +title = "Readability" +weight = 980 ++++ +## AL Coding Guidelines + +## **Readability** + +Generally, all readability rules are Microsoft style choices only. You can use them to keep consistency with the existing code. + +Find the AL guidelines by expanding the menu in the left. diff --git a/content/BCBestPractices/Readability/begin-as-an-afterword/index.md b/content/BCBestPractices/Readability/begin-as-an-afterword/index.md new file mode 100644 index 00000000..3f7dc97d --- /dev/null +++ b/content/BCBestPractices/Readability/begin-as-an-afterword/index.md @@ -0,0 +1,33 @@ ++++ +title = "begin as an 'After Word'" +weight = 230 ++++ + +<_Created by Microsfot, Described by waldo_\> + +## Description + +When `begin` follows `then`, `else`, `do`, it should be on the same line, preceded by one space character. + +## Bad code + +```al + if ICPartnerRefType = ICPartnerRefType::"Common Item No." then + begin + ... + end; +``` + +## Good code + +```al + if ICPartnerRefType = ICPartnerRefType::"Common Item No." then begin + ... + end; +``` + +## [Discussions](https://github.com/microsoft/alguidelines/discussions/categories/bc-best-practices?discussions_q=begin+as+an+After+Word+category%3A%22BC+Best+Practices%22) + +You can find discussions on all "Best Practices" [here](https://github.com/microsoft/alguidelines/discussions/categories/bc-best-practices). + +If you don't find the discussion of this pattern, please feel fee to create a new one with the same title as this article. \ No newline at end of file