Last post Sep 24, 2009 05:17 AM by jyest1978
Sep 23, 2009 04:38 AM|jyest1978|LINK
I thought if the condition1 is false, then the system would just stip checking condition2, is it conrrect in VB.Net?
Sep 23, 2009 05:56 AM|qwe123kids|LINK
yes , if any problem..
Chk the above sample
Sep 23, 2009 06:04 AM|Mohammed Askar|LINK
Everybody confused what is you problem, ask clearly with your sample code
Sep 23, 2009 10:32 AM|David Anton|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'.
Sep 23, 2009 04:32 PM|atconway|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:
If condition1 = False AndAlso condition2 = False Then
Sep 24, 2009 05:17 AM|jyest1978|LINK
Cool..exactly what I was looking for