[Gambas-user] iif bug?
Benoit Minisini
benoit.minisini at ...2...
Thu Apr 27 10:34:25 CEST 2006
On Thursday 27 April 2006 08:08, ron wrote:
> On Thursday 27 April 2006 01:23, Oliver Etchebarne Bejarano wrote:
> > It looks like Gambas is evaluating both true and false parts before
> > doing the iif check, and I think that shouldn't be the correct behavior.
>
> That is correct found.
> I agree partial on not the correct behaviour.
> It is however statet in the help this happens with warning about it.
>
> So far I know javascript does it too and expect java and jscript too
> In MS VB and PHP I know for shure it works as gambas.
> Or better gambas follows some standard behaviour, even when it is not
> logic.
>
> The Iff(cond,true:false) is equivalent to (cond) ? true:false
>
Not at all! IIf evaluates all its arguments. There is no equivalent of
'(cond) ? true : false' in Gambas.
Regards,
--
Benoit Minisini
More information about the User
mailing list