alguidelines/content/docs/BestPractices/separate-if-and-else/index.md
2022-03-26 09:01:43 +01:00

29 lines
512 B
Markdown

---
title: "Seperate if and else"
tags: ["AL","Readability"]
categories: ["Best Practice"]
---
_Created by Microsoft, Described by waldo_
## Description
`if` and `else` statements should be on separate lines.
## <span style="color:FireBrick">Bad code</span>
```al
if Atom = '\>' then HasLogicalOperator := true else begin
...
end;
```
## <span style="color:ForestGreen">Good code</span>
```al
if Atom = '\>' then
HasLogicalOperator := true
else begin
...
end;
```