alguidelines/content/docs/BestPractices/one-statement-per-line/index.md
2022-05-05 16:16:27 +00:00

520 B

title tags categories
One Statement per Line
AL
Readability
Best Practice

Created by Microsoft, Described by waldo

Description

A line of code should not have more than one statement.

Example 1

Bad code

    if OppEntry.Find('-') then exit;  

Good code

    if OppEntry.Find('-') then   
        exit;  

Example 2

Bad code

    TotalCost += Cost; TotalAmt += Amt;  

Good code

    TotalCost += Cost; 
    TotalAmt += Amt;