'Or' and 'And' do not skip - everything is evaluated.
'OrElse' and 'AndAlso' only evaluate until the result can be determined - 'OrElse' stops evaluating on the first 'True' and 'AndAlso' stops evaluating on the first 'False'.
VB.Net does not support "short circuit boolean evaluation" which just means that even if your first expression is false with an AND, it still evaluates the second expression.
Short circuit boolean evaluation can be achieved in VB.NET using the AndAlso or OrElse logical operators
You need to use the following code to accomplish what you are trying to do:
If condition1 = False AndAlso condition2 = False Then
End If
jyest1978
Member
51 Points
168 Posts
if condition1 or condition2 then... are they both checked in all situation?
Sep 23, 2009 08:38 AM|LINK
I thought if the condition1 is false, then the system would just stip checking condition2, is it conrrect in VB.Net?
qwe123kids
All-Star
48619 Points
7957 Posts
MVP
Re: if condition1 or condition2 then... are they both checked in all situation?
Sep 23, 2009 09:56 AM|LINK
Hi,
yes , if any problem..
http://www.startvbdotnet.com/language/ifthen.aspx
Chk the above sample
Avinash Tiwari
Remember to click “Mark as Answer” on the post, if it helps you.
Mohammed Ask...
Contributor
2370 Points
535 Posts
Re: if condition1 or condition2 then... are they both checked in all situation?
Sep 23, 2009 10:04 AM|LINK
Everybody confused what is you problem, ask clearly with your sample code
http://askarnet.wordpress.com
David Anton
Contributor
3704 Points
638 Posts
Re: if condition1 or condition2 then... are they both checked in all situation?
Sep 23, 2009 02:32 PM|LINK
'Or' and 'And' do not skip - everything is evaluated.
'OrElse' and 'AndAlso' only evaluate until the result can be determined - 'OrElse' stops evaluating on the first 'True' and 'AndAlso' stops evaluating on the first 'False'.
http://www.tangiblesoftwaresolutions.com
Instant C# - VB to C# Converter
Instant VB - C# to VB Converter
atconway
All-Star
16846 Points
2756 Posts
Re: if condition1 or condition2 then... are they both checked in all situation?
Sep 23, 2009 08:32 PM|LINK
VB.Net does not support "short circuit boolean evaluation" which just means that even if your first expression is false with an AND, it still evaluates the second expression.
Short circuit boolean evaluation can be achieved in VB.NET using the AndAlso or OrElse logical operators
You need to use the following code to accomplish what you are trying to do:
jyest1978
Member
51 Points
168 Posts
Re: if condition1 or condition2 then... are they both checked in all situation?
Sep 24, 2009 09:17 AM|LINK
Cool..exactly what I was looking for