Reputation:
Can anyone please tell me how to implement select statements in VBScript, similar to switch statement in C? It would be great if you provided some examples as I'm pretty new to VBScript. Thanks.
Upvotes: 1
Views: 6510
Reputation: 342463
example only
Select Case strMyVariable
Case "One" Wscript.Echo "1"
Case "Two" Wscript.Echo "2"
Case "Three" Wscript.Echo "3"
Case Else Wscript.Echo "Wrong"
End Select
Upvotes: 0
Reputation: 27526
Select Case foo
Case 1
MsgBox "1"
Case 2, 3
MsgBox "2 or 3"
Case Else
MsgBox "Something else"
End Select
Upvotes: 10