[Gambas-user] Better IIf?
Fabián Flores Vadell
fabianfloresvadell at ...626...
Thu May 5 16:42:23 CEST 2011
2011/5/4 Jussi Lahtinen <jussi.lahtinen at ...626...>:
> Hi!
> I noticed this while debugging (from http://gambasdoc.org/help/lang/iif?v3);
> "BE CAREFUL!
> Contrary to IF, or the C/Perl ? operator, both TrueExpression and
> FalseExpression are evaluated, whatever the value of Test is.
> "
>
> This is pretty deceptive!
> Can this be re-implement as syntactic sugar (compiler would turn IIf to
> normal If/Else/Then structure)?
>
> Jussi
+1
If TrueExpression or/and FalseExpression are calls to methods, leads
to a logical error because both methods are executed.
Fabián Flores Vadell
--
www.comoprogramarcongambas.blogspot.com
www.speedbooksargentina.blogspot.com
More information about the User
mailing list