IF statement condition expression - order of evaluation

Team -

Does VB have an order of evaluation of a boolean conditional expression inside an IF statement? I have some code that appears to be evaluating both terms of an OR expression even though the first term evaluates to true.

Example for clarity -

IF ((x < 0) Or (functionCall(x)) Then
...

In most languages, if x < 0, the function functionCall is never called.

Is this true for VB, or does VB evaluate all terms in the conditional?

Thanks
bcote
blcoteAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Jim HornConnect With a Mentor Microsoft SQL Server Developer, Architect, and AuthorCommented:
I know that in Access VBA, it will evaluate both expressions, regardless of whether the first expression returns True, and I suspect Excel VBA behaves the same way.
0
 
justchat_1Commented:
yes vb also does...
0
 
justchat_1Commented:
* VB also evaluates all expressions even if the first is true
0
All Courses

From novice to tech pro — start learning today.