Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2002
    Location
    Washington State
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to say "or" in asp script...

    I know it's a really silly question, but I can't find out how to say "or" like this:

    Code:
    If MyValue = "value1" AND MyName = "Bob" OR "James" Then
    bla bla...
    Else
    bla bla...
    END IF
    Any comments would be appreciated. Thanks.


    ~Isaac~
    ~ Isaac Lloyd ~
    Website Design & Development
    http://www.IsaacLloyd.com

  • #2
    Regular Coder
    Join Date
    Dec 2004
    Location
    Jamaica
    Posts
    592
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Just try to keep in mind that the format is
    if <<condition>> then
    <<operations>>
    end if

    So to add conditions you do like so...
    if <<condition>> OR <<condition>> AND <<condition>> then
    <<operations>>
    end if
    and so on...

    So you'd have to do...
    If MyValue = "value1" AND (MyName = "Bob" OR MyName = "James") Then

    Notice the bracketing... You'll have to bracket if you want to do what you were just sayin...
    Reference:
    http://www.w3schools.com/asp
    I'm gonna find a way to download the internet if its the last thing I do...
    Prepare to bow down to me (or my grave) and call me almighty when the algorithm is finished


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •