Shortcircuiting: OrElse in conjunction with Or

If I have the following ...

a OrElse b 

... and a True , then it is clear that b is never evaluated. But if I add Or, then what?

a OrElse b Or c

Should c be rated? But what if I put a few brackets?

Sorry if this is basic. Of course, I can check the answer itself, but I can not find this question here or anywhere else. Many questions related to Or against OrElse , but nothing to do with Or against OrElse

+5
source share
4 answers

. :
http://msdn.microsoft.com/en-us/library/fw84t893.aspx?ppud=4

:

  • , .

( OrElse)

, , Or OrElse .

, , a , b . c . , a , b b Or c. , , c .

, OrElse , Or. Or .

+3

ORElse ( 2 ). , C , (A OrElse B) Or C.

MSDN OrElse

+5

c. :

Debug.WriteLine(test(1) OrElse test(2) Or test(3))

Function test(ByVal a As Integer) As Boolean

    Debug.WriteLine(a)
    Return True

End Function

:

1
3
True
+3

VB , , .

, . .

-1

All Articles