Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Does VBA shortcut "or" statements?
Thanks.
*** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Does VBA shortcut "or" statements?
Explain the question
Regards, Peter T wrote in message ... Thanks. *** |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Does VBA shortcut "or" statements?
No... in expressions containing logical operators (And, Or, Xor, etc.), VB
evaluates every sub-expression even if the first one's evaluation would be enough to determine the expression's value as a whole. Rick wrote in message ... Thanks. *** |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Does VBA shortcut "or" statements?
Explain the question
Shortcutting in this context means that, for example, the right operand of an OR operation is not evaluated if the left operand is True. Logically, shortcutting makes sense, because if the left operand is True, there is no need to evaluate the right operand since the OR is True regardless of the value of the right operand. No, VB/VBA does not shortcut operations. -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) "Peter T" <peter_t@discussions wrote in message ... Explain the question Regards, Peter T wrote in message ... Thanks. *** |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Does VBA shortcut "or" statements?
I kind of suspected that was what the OP meant but didn't want to second
guess a reply. Although logically it might seem as though evaluating the right operand is redundant if the left is true, I assume it always evaluates both as Or works by doing a Bitwise comparison of the pair. v = -1 Or -1 v = -1 Or True v = True Or 0 the above all return -1 but the following returns True. v = True Or True Regards, Peter T "Chip Pearson" wrote in message ... Explain the question Shortcutting in this context means that, for example, the right operand of an OR operation is not evaluated if the left operand is True. Logically, shortcutting makes sense, because if the left operand is True, there is no need to evaluate the right operand since the OR is True regardless of the value of the right operand. No, VB/VBA does not shortcut operations. -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) "Peter T" <peter_t@discussions wrote in message ... Explain the question Regards, Peter T wrote in message ... Thanks. *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Shortcut to switch from "fill down" to "copy" with mouse drag | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
keyboard shortcut to return to previous cell after "find" or "got. | New Users to Excel | |||
Need more than 7 nested "IF" statements in Excel" | Excel Discussion (Misc queries) | |||
Shortcut key for "Paste Options" and "Error Checking" buttons? | Excel Discussion (Misc queries) |