>>>>>>>Take a look here
>>>>>>>
http://blogs.lessthandot.com/index.php/DesktopDev/MSTech/andalso-and-orelse>>>>>>
>>>>>>Yes, but in the example I gave, And would have done it as well, correct?
>>>>>
>>>>>If the first condition is false, we don't need to evaluate the second. AndAlso only evaluates the second condition if the first is true. According to the linked article, both conditions will be evaluated if you used And. In other words, it seems we always want to use AndAlso in VB.NET instead of And
>>>>
>>>>Not *always* :-}
>>>>Consider:
Dim i As Integer = 0
>>>>While True
>>>> If (i > 10) AndAlso (System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1) > 10) Then
>>>> Exit While
>>>> End If
>>>>End While
>>>
>>>:) Not considering such wicked samples, of course.
>>
>>I know - just being difficult.
>>Same principle applies to 'Or' and 'OrElse' of course.....
>
>
>Just use c# and do away with the troubles... :)
Nah, that just translates them to && and || ;)
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up