25

Hi,


Currently in AL we have the common and / or operators which evaluate all expressions within a single statement. ex:

if FuncA() and FuncB() then;

in the above case, FuncB() will be evaluated regardless of the value of FuncA().

There is a cost associated with running a function needlessly.

Furthermore, an error will be raised if FuncB() depends on the success of FuncA().

Currently, the only way in AL to avoid such problems is to use nested conditional statements.


The same goes for the or operator.

if FuncA() or FuncB() then;

If FuncA() evaluates to true there is no need to call FuncB().


A short-circuit logical operators (like the && and || operators in other languages), therefore, seem quite valuable.

Category: Development
STATUS DETAILS
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team