Sunday, December 2, 2012

Use of SELECT CASE

Also during last week's class, I introduced use of SELECT CASE.

The correct syntax is

SELECT CASE variable
     CASE value1
          
' BASIC code statements here will
          execute when variable = value1

     
CASE value2
          
' BASIC code statements here will
          execute when variable = value2

     
CASE value3
          
' BASIC code statements here will
          execute when variable = value3

          ' additional CASEs may follow

END SELECT