Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IF Condition problem in .Net
Message
De
30/08/2003 09:06:12
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
 
À
30/08/2003 06:05:06
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00824754
Message ID:
00824759
Vues:
13
VB.NET retains compatability with VB6 when using AND in a conditional - it attempts to evaluate all of the expressions. For short-circuit conditional expression evaluation, use AndAlso.

P.S. The Val() in Val(CDbl(txtCost.Text)) is not necessary.

>Hi all,
> How does IF condition works with AND clause? I have 2 conditions here. Please look for the below code. FYI, when the control reaches here, the value of txtCost.text = "". Here the system is checking for second condition also, when the first condition itself fails. The same kind of code does not execute the second condition in VFP, when the first fails. Why should .Net execute the second condition? Any idea?
>
>If txtCost.Text <> "" AND Val(CDbl(txtCost.Text)) <> 0 Then
>'... Some code here
>End If
>
>Please let me know your thoughts.
>
>
>Thanks!
>
>Ravi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform