Wednesday, November 12, 2014

VBS If Else Statements

To make an if else statement with VBScript is pretty simple.  First you need to declare your variable, then you need to set your variable, then you use it in the if else statement.  To do this first you declare your variable like this.

dim myVariable

Then to set your variable there are multiple options.  You could do       myVar="Tate"         Or you could do          tateVar=inputbox("What is your name?",0,"hi")    Or even other options.

Then you put it into the statement like this.

dim tate
tate=2
If tate=1 then
    msgbox("Hi")
Else
    msgbox("bye")

No comments:

Post a Comment