From 63551463a0ec049891c0efe31c3e27842e825c6a Mon Sep 17 00:00:00 2001 From: waldo1001 Date: Sat, 11 Dec 2021 13:04:15 +0100 Subject: [PATCH 1/3] Keyword Pairs - Indentation --- .../keyword-pairs-indentation/index.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 content/BCBestPractices/keyword-pairs-indentation/index.md diff --git a/content/BCBestPractices/keyword-pairs-indentation/index.md b/content/BCBestPractices/keyword-pairs-indentation/index.md new file mode 100644 index 00000000..bc10ec50 --- /dev/null +++ b/content/BCBestPractices/keyword-pairs-indentation/index.md @@ -0,0 +1,30 @@ ++++ +title = "Keyword Pairs - Indentation" +weight = 730 ++++ + +<_Created by Microsoft, Described by waldo_\> + +## Description +The `if..then` pair, `while..do` pair, and `for..do` pair must appear on the same line or the same level of indentation. + +## Bad code + +```al + if (x = y) and + (a = b) then +``` + +## Good code + +```al + if (x = y) and + (a = b) + then +``` + +## [Discussions](https://github.com/microsoft/alguidelines/discussions/categories/bc-best-practices?discussions_q=keyword+pair+indentation+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 guideline, please feel fee to create a new one with the same title as this article. \ No newline at end of file From 39340ca56db7401012ba31df6bd006c84682b1d2 Mon Sep 17 00:00:00 2001 From: waldo1001 Date: Sat, 11 Dec 2021 13:28:59 +0100 Subject: [PATCH 2/3] Move --- .../{ => Readability}/keyword-pairs-indentation/index.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename content/BCBestPractices/{ => Readability}/keyword-pairs-indentation/index.md (100%) diff --git a/content/BCBestPractices/keyword-pairs-indentation/index.md b/content/BCBestPractices/Readability/keyword-pairs-indentation/index.md similarity index 100% rename from content/BCBestPractices/keyword-pairs-indentation/index.md rename to content/BCBestPractices/Readability/keyword-pairs-indentation/index.md From 32e73b30eef702904065b63d9c7679c5808a1ccb Mon Sep 17 00:00:00 2001 From: waldo1001 Date: Mon, 13 Dec 2021 17:16:07 +0100 Subject: [PATCH 3/3] requested change --- .../Readability/keyword-pairs-indentation/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/BCBestPractices/Readability/keyword-pairs-indentation/index.md b/content/BCBestPractices/Readability/keyword-pairs-indentation/index.md index bc10ec50..9bbae6a9 100644 --- a/content/BCBestPractices/Readability/keyword-pairs-indentation/index.md +++ b/content/BCBestPractices/Readability/keyword-pairs-indentation/index.md @@ -6,20 +6,20 @@ weight = 730 <_Created by Microsoft, Described by waldo_\> ## Description -The `if..then` pair, `while..do` pair, and `for..do` pair must appear on the same line or the same level of indentation. +The `if..then` pair, `while..do` pair, and `for..do` pair must appear on the same line or the same level of indentation. If possible, you can align the lines it is even much more readable. ## Bad code ```al if (x = y) and - (a = b) then + (a = b) then ``` ## Good code ```al if (x = y) and - (a = b) + (a = b) then ```