On Thu, Jan 13, 2011 at 00:51, Marc Weustink <marc.weust...@cuperus.nl> wrote:
>
> Note that there is a tiny little difference between those two.
>
> the ?: operator evaluates either the TruePart or FalsePart while IfThen will
> evaluate both parts first.

Exactly. This is why for me IfThen is much less useful then
conditional operators in other languages.
I think a better alternative would be Algol-like if-expression:
a := (if x > 0 then x else -x);

-- 
Alexander S. Klenin
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to