Chapter Summary

Conditional statements, introduced in this chapter, let you control the flow of your procedure. By testing the truth of a condition, you can decide which statements should be run and which should be skipped over. In other words, instead of running your procedure from top to bottom, line by line, you can execute only certain lines. Here are a few guidelines to help you determine what kind of conditional statement you should use:

If you want to supply only one condition, the simple If.. .Then statement is the best choice.

If you need to decide which of two actions to perform, use the If.. .Then.. .Else statement. ■ If your procedure requires two or more conditions, use the If.. .Then.. .ElseIf or Select Case statements.

If your procedure has many conditions, use the Select Case statement. This statement is more flexible and easier to comprehend than the If.. .Then.. .ElseIf statement.

Sometimes decisions have to be repeated. The next chapter teaches you how to perform the same steps over and over again.

Chapter 6

0 0

Post a comment