VBScript Basics, Part 32 | Select Case


VBScripting (.vbs) Basic tutorial on how to use the Select Case command, which is similar to an If Statement.

Code Example:
______________________________________________________

Option Explicit
Dim pass

pass=InputBox(“what is your password”)

Select Case pass
Case “orange”
MsgBox “correct”
Case “”
MsgBox “please fill out”
Case Else
MsgBox “incorrect”
End Select
______________________________________________________

Know the Basics:
——————————————————————————————
Select Case VARIABLE
Case “WHATEVER”
…code here
Case “WHATEVER”
…code here
Case Else
…code here
End Select
——————————————————————————————


Leave a Comment