In a Boolean comparison, the Or operator always evaluates both expressions, which could include making procedure calls. The OrElse Operator (Visual Basic) performs short-circuiting, which means that if expression1 is True, then expression2 is not evaluated.
But you don’t have to endure it. You can use
OrElse
to get short-circuiting behaviour.So you probably want:
If (example Is Nothing OrElse Not example.Item = compare.Item) Then
‘Proceed
End If
http://stackoverflow.com/questions/4723249/vb-net-if-statement-with-or-condit…