memberlogin
contactus
randomfacts

If ElseIf Else Statement In Vbscript

To use an if elseif else statement in vbscript is easy.  You simply have your first condition in the if statement and if it is true then the code after the then will be run, then you place a second condition in the elseif statement and if that statement is true then the code after it\'s then will be run, and finally if neither of the first two conditions are true then the else statement is run.  The else statement is optional and you can use as many elseif statements as you need.

<%

If myvariable = "hello" Then

       Response.write "Hello World"

  ElseIf myvariable = "goodbye" Then

       Response.write "Goodbye World"

  Else

       Response.write "Not sure World"

  End If

%>