alguidelines/content/docs/BestPractices/one-statement-per-line/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

37 lines
488 B
Markdown

---
title: "One Statement per Line"
tags: ["AL","Readability"]
categories: ["Best Practice"]
---
_Created by Microsoft, Described by waldo_
## Description
A line of code should not have more than one statement.
## Bad code
```al
if OppEntry.Find('-') then exit;
```
## Good code
```al
if OppEntry.Find('-') then
exit;
```
## Bad code
```al
TotalCost += Cost; TotalAmt += Amt;
```
## Good code
```al
TotalCost += Cost;
TotalAmt += Amt;
```