Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Isn't this the same?
Message
 
 
General information
Forum:
Internet
Category:
VBScript
Miscellaneous
Thread ID:
00426966
Message ID:
00427052
Views:
18
>This works:
>
>If rsResults("GA")=0 Then
>   m_GA = ""
>Else
>   m_GA = ConvertNull(rsResults("GA"))
>End If
>
But this doesn't (Type mismatch error):
>
>m_GA = IIf(rsResults("GA")=0,"",ConvertNull(rsResults("GA")))
>
Anyone know why? TIA.

Unlike VFP, VBSCript (and VB for that matter) evaluates both expressions in an IIF() (even if the first is already foound to be true). Once they are both evaluated, then the appropriate one is performed. However, by that time, it could already have caused an error.

FWIW, VB 7 is supposed to stop after it finds the first true expression (as VFP does now).
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform