Wow, Kuddo's to MajP ! ;-)
Aside from the technical aspects of speed (measured in nano-seconds) ... let's not overly confuse the issue here. Efficiency is all about OVERALL Efficiency.
Example: How many times have we all had to adjust or modify someone else's code or even our own after 3-6+ months after we rolled it out ? We end up spending hours trying to figure it out.
Rather than If this then this, or If this but not that uless this and the other thing are there ... a simple select statement can be very powerful.
They can also be far easier to read ... consider creating a temporary data mining string before a select.
Example:
if A < 0 then DM_STR = "-"
else if A = 0 then DM_STR = "0"
else DM_STR = "+"
if B < 0 then DM_STR = DM_STR & "-"
else if B = 0 then DM_STR = DM_STR & "0"
else DM_STR = DM_STR & "+"
select DM_STR
case "--"
' Both are neg
case "-0"
' A is neg, B is zero
case ...
end select
Lots of code, but for situations with messy data, it can be far easier to keep track of downstream.
For really messy situations where there are plethoras of nested IF statements, a simple temporary data mining string and a clear select statement can make all of the difference in the world.
Again, Kudo's to MajP ... that was a great answer.
Alan J. Volkert
Fleet Services
GE Commercial Finance Capital Solutions
(World's longest company title)
Eden Prairie, MN