Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Isn't this the same?
Message
 
 
Information générale
Forum:
Internet
Catégorie:
VBScript
Divers
Thread ID:
00426966
Message ID:
00427052
Vues:
19
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform