Boolean Expression - Order of Operations

前端 未结 1 1465
再見小時候
再見小時候 2020-12-12 01:35

I have a test in Excel VBA:

If (test1) And (test2) And (test3) Then
    \'do something
End If

In C, Java, etc. test1 would be run first, then test2, th

相关标签:
1条回答
  • 2020-12-12 01:59

    In all VBs prior to .NET there is no such thing as short-circuit. All expressions will be evaluated even if not required. If you want short-curcuit, do nested IFs.

    0 讨论(0)
提交回复
热议问题