Precedence of operators

When expressions are evaluated by the C/AL compiler, the parsing routines use a predefined precedence hierarchy to determine what operators to evaluate first, what to evaluate second, and so forth. That precedence hierarchy is provided in the NAV Developer and IT Pro Help section, C/AL Operators (https://msdn.microsoft.com/en-us/dynamics-nav/c-al-operators), but for convenience, the information is repeated here:

For complex expressions, we should always freely use parentheses to make sure the expressions are evaluated the way we intend.

Get Programming Microsoft Dynamics NAV - Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.