<p>Am 02.02.2016 08:34 schrieb "Anthony Walter" <<a href="mailto:sysrpl@gmail.com">sysrpl@gmail.com</a>>:<br>
><br>
> Sven,<br>
><br>
> I missed this post when you made it a two days ago. If someone hasn't already asked, does your implementation support short circuit evaluation?<br>
><br>
> For example:<br>
><br>
> BasketCount := IfThen(ShoppingList <> nil, ShoppingList.Count, 0);<br>
><br>
> Where evaluating ShoppingList.Count will cause an exception if ShoppingList is nil.<br>
><br>
> Also the reverse should short circuit as well:<br>
><br>
> BasketCount := IfThen(ShoppingList = nil, 0, ShoppingList.Count);</p>
<p>You're mixing up two things. Short circuit evaluation in terms of Pascal is that in expressions using "and" and "or" the evaluation is aborted if the result is already determined. This is controlled by a compiler directive and is respected by all Boolean expressions.<br>
What you mean is that the compiler does not evaluate all branches of the if and that is the main reason I introduced this intrinsic. In fact the IfThen() behaves just like an ordinary if-statement in that regard as I had mentioned in my original mail.</p>
<p>Regards,<br>
Sven</p>