Really simple Question.

Discussion in 'ASP General' started by Graham Mattingley, Sep 4, 2003.

  1. I think I have lost my brain, or drank too much Redbull, because I cant make
    the following work.


    if menu_list <> "age" OR menu_list <> "first_name" then
    ....
    else
    .......
    end if

    If I do this below, it works.

    if menu_list <> "age" then
    ....
    else
    .......
    end if

    How do I this with more than one option, is it with ELSE IF ??

    Kind Regards

    Graham Mattingley
     
    Graham Mattingley, Sep 4, 2003
    #1
    1. Advertising

  2. Graham Mattingley

    Tom B Guest

    You'll never get to your else, because it will always match your expression
    Example1: menu_list ="age" --- it doesn't equal "first_name" so it'll do
    what's in the if
    Example2: menu_list="first_name" --- it doesn't equal "age" so it'll do
    what's in the if
    Example3: menu_list="BOB" --- it doesn't equal either, so it'll do what's in
    the if.

    I assume you want to use an AND

    if menu_list <> "age" AND menu_list<>"first_name" then
    'Example 3 would end up here
    else
    'Example 1 and 2 would end up here
    end if


    OR

    if menu_list="age" OR menu_list="first_name" then
    'Example 1 and 2 would end up here
    else
    'Example 3 would end up here
    end if



    "Graham Mattingley" <> wrote in message
    news:bj863g$sc5$1$...
    > I think I have lost my brain, or drank too much Redbull, because I cant

    make
    > the following work.
    >
    >
    > if menu_list <> "age" OR menu_list <> "first_name" then
    > ...
    > else
    > ......
    > end if
    >
    > If I do this below, it works.
    >
    > if menu_list <> "age" then
    > ...
    > else
    > ......
    > end if
    >
    > How do I this with more than one option, is it with ELSE IF ??
    >
    > Kind Regards
    >
    > Graham Mattingley
    >
    >
    >
    >
     
    Tom B, Sep 4, 2003
    #2
    1. Advertising

  3. Thanks Tom,

    I knew it would be simpleish, think I have been at the screen to long today
    :)

    it is all working now :)

    Graham Mattingley

    "Tom B" <> wrote in message
    news:#...
    > You'll never get to your else, because it will always match your

    expression
    > Example1: menu_list ="age" --- it doesn't equal "first_name" so it'll do
    > what's in the if
    > Example2: menu_list="first_name" --- it doesn't equal "age" so it'll do
    > what's in the if
    > Example3: menu_list="BOB" --- it doesn't equal either, so it'll do what's

    in
    > the if.
    >
    > I assume you want to use an AND
    >
    > if menu_list <> "age" AND menu_list<>"first_name" then
    > 'Example 3 would end up here
    > else
    > 'Example 1 and 2 would end up here
    > end if
    >
    >
    > OR
    >
    > if menu_list="age" OR menu_list="first_name" then
    > 'Example 1 and 2 would end up here
    > else
    > 'Example 3 would end up here
    > end if
    >
    >
    >
    > "Graham Mattingley" <> wrote in message
    > news:bj863g$sc5$1$...
    > > I think I have lost my brain, or drank too much Redbull, because I cant

    > make
    > > the following work.
    > >
    > >
    > > if menu_list <> "age" OR menu_list <> "first_name" then
    > > ...
    > > else
    > > ......
    > > end if
    > >
    > > If I do this below, it works.
    > >
    > > if menu_list <> "age" then
    > > ...
    > > else
    > > ......
    > > end if
    > >
    > > How do I this with more than one option, is it with ELSE IF ??
    > >
    > > Kind Regards
    > >
    > > Graham Mattingley
    > >
    > >
    > >
    > >

    >
    >
     
    Graham Mattingley, Sep 4, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Amir
    Replies:
    3
    Views:
    602
  2. nc
    Replies:
    1
    Views:
    505
    nice.guy.nige
    Feb 3, 2005
  3. Jeannie
    Replies:
    15
    Views:
    896
    Jeannie
    Aug 30, 2005
  4. =?Utf-8?B?TFc=?=
    Replies:
    8
    Views:
    429
    =?Utf-8?B?TFc=?=
    Apr 25, 2007
  5. LW
    Replies:
    1
    Views:
    180
    Alexey Smirnov
    May 2, 2007
Loading...

Share This Page