Mutiple conditions in an if statement

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Mutiple conditions in an if statement

    This might seem like a silly question but how do you form an if statement
    involving 2 conditions within ASP (VBScript)

    I tried this with no luck:

    if ((loggedIn = "False") and (CurrentPage != 3)) then


    Any suggestions

    Thanks

    Terry


    Terry Murray Guest

  2. Similar Questions and Discussions

    1. About mutiple Sliders
      Hi everyone, I want your help............. what i want to do is that i have to take multiple vsliders i.e max =4 and i want to attach a hrule to...
    2. Mutiple Users
      hello, Does anyone know if the dreamweaver login PHP scrips will support mutiple users. I seem to have developed an issue of login, things work...
    3. One Record Mutiple Cats
      Hi there I am building a property database, The customer requires that a property can have mutiple types Can anyone tell me how I could achieve...
    4. Mutiple scanned pictures - need help please ...
      I have been using PE-2 for some time, but can't calim to know it well (yet). If I scan, say, two photos at once (one next to the other) and want...
    5. select statement form mutiple data sources
      Hello, I have information in a Access data base and a SQL database, but i need to be able to create a select statment which pulls information...
  3. #2

    Default Re: Mutiple conditions in an if statement

    Terry Murray wrote:
    > This might seem like a silly question but how do you form an if
    > statement involving 2 conditions within ASP (VBScript)
    >
    > I tried this with no luck:
    >
    > if ((loggedIn = "False") and (CurrentPage != 3)) then
    >
    >
    > Any suggestions
    >
    > Thanks
    >
    > Terry
    That should have worked. What does "no luck" mean?

    Bob Barrows


    Bob Barrows Guest

  4. #3

    Default Re: Mutiple conditions in an if statement

    You're mixing VB Script and JScript. In VB Script, "not equal to" is <>.

    If LoggedIn = "False" and CurrentPage <> 3 Then

    But, you may have to take extra care with you variable types and even
    shorten it:

    If Not CBool(LoggedIn) And CInt(CurrentPage) <> 3 Then...

    Ray at home

    --
    Will trade ASP help for SQL Server help


    "Terry Murray" <tgmurray@rogers.com> wrote in message
    news:o_AYa.76750$4UE.14262@news01.bloor.is.net.cab le.rogers.com...
    > This might seem like a silly question but how do you form an if statement
    > involving 2 conditions within ASP (VBScript)
    >
    > I tried this with no luck:
    >
    > if ((loggedIn = "False") and (CurrentPage != 3)) then
    >
    >
    > Any suggestions
    >
    > Thanks
    >
    > Terry
    >
    >

    Ray at Guest

  5. #4

    Default Re: Mutiple conditions in an if statement

    Oh, duh! Can't believe i missed that. I've been staring at T-SQL code all
    day today. It would have helped if the OP had told us the error message ...
    ok, no excuses!

    Bob

    Ray at <%=sLocation%> wrote:
    > You're mixing VB Script and JScript. In VB Script, "not equal to" is
    > <>.
    >
    > If LoggedIn = "False" and CurrentPage <> 3 Then
    >
    > But, you may have to take extra care with you variable types and even
    > shorten it:
    >
    > If Not CBool(LoggedIn) And CInt(CurrentPage) <> 3 Then...
    >
    > Ray at home
    >
    >
    > "Terry Murray" <tgmurray@rogers.com> wrote in message
    > news:o_AYa.76750$4UE.14262@news01.bloor.is.net.cab le.rogers.com...
    >> This might seem like a silly question but how do you form an if
    >> statement involving 2 conditions within ASP (VBScript)
    >>
    >> I tried this with no luck:
    >>
    >> if ((loggedIn = "False") and (CurrentPage != 3)) then
    >>
    >>
    >> Any suggestions
    >>
    >> Thanks
    >>
    >> Terry


    Bob Barrows Guest

  6. #5

    Default Re: Mutiple conditions in an if statement

    You're falling apart Bob. ;P

    Ray at home

    --
    Will trade ASP help for SQL Server help


    "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    news:e4R0roTXDHA.2640@TK2MSFTNGP09.phx.gbl...
    > Oh, duh! Can't believe i missed that. I've been staring at T-SQL code all
    > day today. It would have helped if the OP had told us the error message
    ....
    > ok, no excuses!
    >
    > Bob
    >
    > Ray at <%=sLocation%> wrote:
    > > You're mixing VB Script and JScript. In VB Script, "not equal to" is
    > > <>.
    > >
    > > If Logg

    Ray at Guest

  7. #6

    Default Re: Mutiple conditions in an if statement

    Damn! Do you think anyone else noticed?

    Bob

    Ray at <%=sLocation%> wrote:
    > You're falling apart Bob. ;P
    >
    > Ray at home
    >
    >
    > "Bob Barrows" <reb_01501@yahoo.com> wrote in message
    > news:e4R0roTXDHA.2640@TK2MSFTNGP09.phx.gbl...
    >> Oh, duh! Can't believe i missed that. I've been staring at T-SQL
    >> code all day today. It would have helped if the OP had told us the
    >> error message ... ok, no excuses!
    >>
    >> Bob
    >>
    >> Ray at <%=sLocation%> wrote:
    >>> You're mixing VB Script and JScript. In VB Script, "not equal to"
    >>> is <>.
    >>>
    >>> If Logg


    Bob Barrows Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139