alguidelines/content/BCBestPractices/Readability/spacing-binary-operators/index.md
2021-12-14 11:50:50 +01:00

820 B

+++ title = "Spacing Binary Operators" weight = 1120 +++

<Created by Microsoft, Described by waldo>

Description

There must be exactly one space character on each side of a binary operator such as = + - AND OR =. The parameter comma operator however, should have a space after the comma.

Bad code

    "Line Discount %" := "Line Discount Amount"/"Line Value"*100;  

Good code

    "Line Discount %" := "Line Discount Amount" / "Line Value" * 100;  

Bad code

    StartDate := CalcDate('<+'+Format(Days+i)+'D\>',StartDate);  

Good code

    StartDate := CalcDate('<+' + Format(Days + i) + 'D\>', StartDate);  

Bad code

    StartDate:=0D; // Initialize  

Good code

    StartDate := 0D; // Initialize