added indentation

This commit is contained in:
christianbraeunlich 2022-03-19 22:11:52 +01:00
parent 4fbfc28c9e
commit 83053e7287
6 changed files with 22 additions and 24 deletions

View file

@ -15,7 +15,7 @@ When `begin` follows `then`, `else`, `do`, it should be on the same line, preced
```al
if ICPartnerRefType = ICPartnerRefType::"Common Item No." then
begin
...
...
end;
```
@ -23,7 +23,6 @@ When `begin` follows `then`, `else`, `do`, it should be on the same line, preced
```al
if ICPartnerRefType = ICPartnerRefType::"Common Item No." then begin
...
...
end;
```

View file

@ -13,7 +13,7 @@ Only use begin..end to enclose [compound statements](https://docs.microsoft.com/
```AL
if FindSet() then begin
repeat
...
...
until next() = 0;
end;
```
@ -23,7 +23,7 @@ end;
```AL
if FindSet() then
repeat
...
...
until next() = 0;
```
@ -52,4 +52,3 @@ if X then begin
end else
(not X)
```

View file

@ -8,20 +8,20 @@ _Created by Microsoft, Described by waldo_
## Description
Do not start a line with a binary operator.
Do not start a line with a binary operator.
## Bad code
```AL
"Quantity to Ship" :=
Quantity
- "Quantity Shipped"
Quantity
- "Quantity Shipped"
```
## Good code
```AL
"Quantity to Ship" :=
Quantity -
"Quantity Shipped"
Quantity -
"Quantity Shipped"
```

View file

@ -15,11 +15,11 @@ The `end else` pair should always appear on the same line.
```al
if OppEntry.Find('-') then
if SalesCycleStage.Find('-') then begin
...
...
end
else
begin
...
...
end;
```
@ -28,8 +28,8 @@ The `end else` pair should always appear on the same line.
```al
if OppEntry.Find('-') then
if SalesCycleStage.Find('-') then begin
...
...
end else begin
...
...
end;
```

View file

@ -8,20 +8,20 @@ _Created by Microsoft, Described by waldo_
## Description
`if` and `else` statements should be on separate lines.
`if` and `else` statements should be on separate lines.
## Bad code
```al
if Atom = '\>' then HasLogicalOperator := true else begin
...
if Atom = '>' then HasLogicalOperator := true else begin
...
end;
```
## Good code
```al
if Atom = '\>' then
if Atom = '>' then
HasLogicalOperator := true
else begin
...

View file

@ -13,31 +13,31 @@ There must be exactly one space character on each side of a binary operator such
## Bad code
```al
"Line Discount %" := "Line Discount Amount"/"Line Value"*100;
"Line Discount %" := "Line Discount Amount"/"Line Value"*100;
```
## Good code
```al
"Line Discount %" := "Line Discount Amount" / "Line Value" * 100;
"Line Discount %" := "Line Discount Amount" / "Line Value" * 100;
```
## Bad code
```al
StartDate := CalcDate('<+'+Format(Days+i)+'D\>',StartDate);
StartDate := CalcDate('<+'+Format(Days+i)+'D\>',StartDate);
```
## Good code
```al
StartDate := CalcDate('<+' + Format(Days + i) + 'D\>', StartDate);
StartDate := CalcDate('<+' + Format(Days + i) + 'D\>', StartDate);
```
## Bad code
```al
StartDate:=0D; // Initialize
StartDate:=0D; // Initialize
```
## Good code