If Or

Nothing wrong with that, except you should use the logic OrElse operator.
Visual Basic:
If a = b OrElse a = c OrElse a = d OrElse a = e Then
 
Or is for boolean math, OrElse is for logical comparison. It's 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, it'll evaluate the next one, and if it's true it'll 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