Use procedure call with parentheses instead of assign value #235
Arthurvdv
started this conversation in
Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
To prevent confusion (and maybe future compatibility issues) create a new rule: do not assign a value directly to a procedure, but always call the procedure using parentheses.
Example 1: Built-in methods
Both lines currently compile and work. However, only the second form makes it clear that a method is being called.
Example 2: Public procedures on a codeunit
While assigning a value to a procedure may look like a formatting choice, it could introduces ambiguity.
If the AL language would evolves to support properties on objects (such as table, codeunits, ...) statements like these could become unclear; Is this a property assignment or a method call?
Beta Was this translation helpful? Give feedback.
All reactions