Reputation: 2050
I trying to create an if statement in ASP/VBScript that will look like the following
if ConditionToTest then
//first statment to execute
//second statment to exexute
ElseIf DifferentConditionToTest then
//first statment to execute
//second statment to exexute
End If
The problem is a get various errors from asking for another End If to it simply not executing the second ElseIF. Does ASP/VBScript support multiple statements inside an if like above and if so if there a special way I should be doing it?
Upvotes: 0
Views: 571
Reputation: 4608
This syntax is correct. In your real code, check to make sure that "ElseIf" is one word, and that you correctly balance If with End If, Do While with Loop, For with Next, etc.
Also, you cannot use "//" as comments in VBScript.
If you're still stuck, please post your code.
Upvotes: 3