Chapter 3 Controlling Program Flow

In this chapter, you'll learn about decision making — how to write procedures that test conditions and then run only certain statements based on the results of those tests. You'll also learn about looping, or running a group of statements several times; and you'll learn about nesting, or placing one control structure inside another.

The statements that control decision making and looping in Visual Basic are called control structures. Without control structures, a procedure's logic flows through statements from left to right and from top to bottom. Although you can write some very simple procedures with this unidirectional flow, most of the power and flexibility of any programming language comes from its ability to use control structures to change the order in which statements are run.

Contents