Can't get this If statement to work

Posted on 2006-06-05
Last Modified: 2010-04-06

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

Response.write ("Got It")
End IF %>
Question by:eteran
    LVL 54

    Accepted Solution


    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

    LVL 54

    Expert Comment

    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.

    LVL 54

    Expert Comment

    I'm glad that I could help.  Thank you for the grade, the points and the fun question!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
    Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL ( several years ago, it seemed like now was a good time to updat…
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
    HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now