Visual Basic .NET supports all the conditional and loop statements supported by its predecessors—that is, the If and Select conditional blocks and the For, Do, and While loop statements. Nevertheless, Visual Basic .NET offers some new features in this area as well, and Visual Basic .NET 2003 adds a new way to declare the controlling variable in For and For Each loops.
Short-Circuit Evaluation with AndAlso and OrElse Operators
Short-circuit evaluation allows you to avoid the unnecessary evaluation of Boolean subexpressions if they wouldn’t affect the value of the main expression. Let’s see a simple example:
CODES: