• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 13. Control Statements > The Select Case Statement

13.6. The Select Case Statement

As we have seen, the If...Then... construct is used to perform different tasks based on different possibilities. An alternative construct that is often more readable is the Select Case statement, whose syntax is:

Select Case testexpression
   Case value1
      ' statements to execute if testexpression = value1
   Case value2
      ' statements to execute if testexpression = value2

   . . .

   Case Else
      ' statements to execute otherwise
End Select


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint