If Or

Nothing wrong with that, except you should use the logic OrElse operator.
Code:
If a = b OrElse a = c OrElse a = d OrElse a = e Then
 
Or is for boolean math, OrElse is for logical comparison. Its basically Or in VB is | in C++, and OrElse in VB is || in C++. I believe it will evaluate each expression individually and if it is false, itll evaluate the next one, and if its true itll go right into the If block.
 
As well you can use the new AndAlso.

It behaves somewhat like OrElse, if the first condition is false it stops evaluating.
 
Back
Top