Hour 13. Making Decisions in Visual Basic Code

What You’ll Learn in This Hour

Making decisions using If...Then

• Expanding the capability of If...Then using Else and ElseIf

Evaluating an expression for multiple values using Select Case

• Redirecting code flow using GoTo

In Hour 10, “Creating and Calling Code Procedures,” you learned to separate code into multiple procedures so that they can be called in any order required. This goes a long way in organizing code, but you still need a way to selectively execute code procedures or groups of statements within a procedure. You use decision-making techniques to accomplish this. Decision-making constructs are coding structures that enable you to execute or omit code based on a condition, such ...

Get Sams Teach Yourself Visual Basic 2012 in 24 Hours, Complete Starter Kit now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.