n3olcsatok
New Member
- Joined
- Jun 7, 2011
- Messages
- 5
Hi there!
I would like make use of the order in which the logical operators, such as AND and OR are interpreted. For example, in C and C++ the AND operator is interpreted from left to right, so if the expression on the left side of the operator is false, the rest is not processed at all.
In particular, with something like the follwing code:
where foo() returns a boolean, to do this:
If myBoolean is false, foo() is not executed
If myBoolean is true, foo() is executed and the result is used for the AND expression.
I wonder if anyone knows whether VBA has such an order and what it is like?
I would like make use of the order in which the logical operators, such as AND and OR are interpreted. For example, in C and C++ the AND operator is interpreted from left to right, so if the expression on the left side of the operator is false, the rest is not processed at all.
In particular, with something like the follwing code:
Code:
If myBoolean And foo() Then
If myBoolean is false, foo() is not executed
If myBoolean is true, foo() is executed and the result is used for the AND expression.
I wonder if anyone knows whether VBA has such an order and what it is like?