alguidelines/content/docs/BestPractices/end-else-pair/index.md
Henrik Helgesen fb17dc9640 Removed Discussion Links. Using new Theme solution.
Some additional MDLint cleanup as well
2022-02-24 15:36:06 -08:00

35 lines
552 B
Markdown

---
title: "end else pair"
tags: ["AL","Readability"]
categories: ["Best Practice"]
---
_Created by Microsoft, Described by waldo_
## Description
The `end else` pair should always appear on the same line.
## Bad code
```al
if OppEntry.Find('-') then
if SalesCycleStage.Find('-') then begin
...
end
else
begin
...
end;
```
## Good code
```al
if OppEntry.Find('-') then
if SalesCycleStage.Find('-') then begin
...
end else begin
...
end;
```