Visual Basic 2008 Programming: Business Applications with a Design Perspective
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9
Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Appendix A Appendix B Appendix C Home
Loading
Last change: February 13 2016 18:48:19.

 Chapter in PDF

Table of Contents

Chapter 5: Decision
Last change: February 13 2016 18:47:58.
<<PreviousNext>>

5.3   The Select Case Block

As explained in Section 5.2, an alternative to the If block is the Select Case block, which is particularly useful when the decision depends on the result of one single expression. Consider the previous example of assigning a grade based strictly on the student’s score. The grade will be A, B, or C if the score is at least 90, 80, or below 80, respectively. This problem can be conveniently solved by the use of the Select Case block.
Last change: February 13 2016 18:47:58.
  1. Simple If Block
  2. The If…Then…Else…End If Block
  3. The If…Then…ElseIf…Then…Else…End If Block
  4. Nesting If Blocks
  5. Additional Notes on Coding the If Block
  • 5.3 The Select Case Block
    1. Syntax Structure
    2. Nesting Select Case Blocks
    3. Additional Notes
    4. <<PreviousNext>>