Select
Previous Top Next

Select is used to test one value with several values.
Only the first case that matches will execute.
Syntax:
Select value
            Case Value1
                        ...
            Case Value2,Value3,Value4 (True if one of the values matches)
                        ...
            Case Else
                        ...
End Select

Example:
Select StrToLower(TextBox1.Text)
            Case ""
                        Return
            Case "red"
                        Form1.Color = cRed
            Case "blue"
                        Form1.Color = cBlue
            Case Else
                        Form1.Color = cWhite
End Select