[thelist] ASP equivalent of $var = ($a == 0) ? 'hello' : 'goodbye';

Paul Cowan evolt at funkwit.com
Wed Dec 10 16:07:40 CST 2003



Kristof Neirynck wrote:

> This should work.
>
> Dim var as String
> var = iif(a = 0, "Hello", "goodbye")

No it shouldn't. iif() is not a valid VBScript function.

You could create a replacement iif() yourself -- but note that it won't
be quite the same, due to VBScript's lack of short-circuit evaluation.

Cheers,

Paul


More information about the thelist mailing list