Select Case

The  Select..Case statement is a special instance of the IF  structure. To implement multi-way decisions the  statement provides a more concise and elegant representation than multiple and statements, which can get very difficult to follow. Probably if you have more than three conditional statements you should consider using the Select..Case statement instead.

Here is an example algorithm

  1. Ask user to input a number between 1 and 7
  2. select case number
  3. Case is = 1 Display “Sunday”
  4. Case is = 2 Display “Monday”
  5. Case is = 3 Display “Tuesday”
  6. Case is = 4 Display “Wednesday”
  7. Case is = 5 Display “Thursday”
  8. Case is = 6 Display “Friday”
  9. Case is = 7 Display “Saturday”
  10. Case else Display “Error”
  11. End Select