Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IF Condition problem in .Net
Message
From
30/08/2003 09:06:12
Keith Payne
Technical Marketing Solutions
Florida, United States
 
 
To
30/08/2003 06:05:06
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00824754
Message ID:
00824759
Views:
14
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform