Can't get this If statement to work



<%if strType =((3) or (4) or (5) or (6))  then

Response.write ("Got It")
End IF %>
eteranAsked:
Who is Participating?
 
b0lsc0ttConnect With a Mentor IT ManagerCommented:
eteran,

If statements are in this format.

<%
If strType = 3 OR strType = 4 OR strType = 5 or strType = 6 then
   Response.Write "Got it"
End if
%>

b0lsc0tt
0
 
b0lsc0ttIT ManagerCommented:
You need to repeat the test for each OR so I inserted "strType = " for each number.  ASP (vbscript) does not need the statement to be in parenthesis.

Just a side note, but using parenthesis for a response.write string is not needed and I believe has been deprecated.  I am not sure about that though. :-)

Let me know if you have a question or need clarification.

bol
0
 
b0lsc0ttIT ManagerCommented:
I'm glad that I could help.  Thank you for the grade, the points and the fun question!

bol
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.