alguidelines/content/docs/NAVPatterns/3-cal-coding-guidelines/readability/end-else-pair/index.md
2022-02-24 14:45:35 +01:00

409 B

+++ title = "END ELSE Pair" weight = 540 tags = ["C/AL","Readability"] categories = ["Best Practice"] +++ The END ELSE pair should always appear on the same line.

Bad code

IF OppEntry.FIND('-') THEN
    IF SalesCycleStage.FIND('-') THEN BEGIN
        ...
    END
ELSE
    ...

Good code

IF OppEntry.FIND('-') THEN
    IF SalesCycleStage.FIND('-') THEN BEGIN
        ...
END ELSE
    ...