Can i say OR in an if/then statement

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • crispy

    Can i say OR in an if/then statement

    I am trying to say

    if (condition) is true OR (condition) is true THEN

    Can I use OR or do ihave to break it down into an elseif statement?

    I tried OR but it does not seem to work.

    thanks. crispy
  • Mosley

    #2
    Re: Can i say OR in an if/then statement


    "crispy" <polaatx@REMO VE THIS PART yahoo.com> wrote in message
    news:n8bngvk24e gp4m75dsd30kt22 bko24egfo@4ax.c om...[color=blue]
    > I am trying to say
    >
    > if (condition) is true OR (condition) is true THEN
    >[/color]

    if (condition) OR (condition) THEN

    or

    if (condition) = true OR (condition) = true THEN

    but remeber that is a boolean value true or false, it is not the same a
    string value "true"

    in that case

    use
    if (condition) = 'true' OR (condition) = 'true' THEN

    you may even want to use lcase(condition ) = 'true'

    lcase(value) chanes it to lower case



    [color=blue]
    > Can I use OR or do ihave to break it down into an elseif statement?
    >
    > I tried OR but it does not seem to work.
    >
    > thanks. crispy[/color]


    Comment

    • Tim

      #3
      Re: Can i say OR in an if/then statement

      I can only guess that you tried

      if x=5 or 10 then

      which is incorrect and should be

      if x=5 or x=10 then


      Tim



      "crispy" <polaatx@REMO VE THIS PART yahoo.com> wrote in message
      news:n8bngvk24e gp4m75dsd30kt22 bko24egfo@4ax.c om...[color=blue]
      > I am trying to say
      >
      > if (condition) is true OR (condition) is true THEN
      >
      > Can I use OR or do ihave to break it down into an elseif statement?
      >
      > I tried OR but it does not seem to work.
      >
      > thanks. crispy[/color]


      Comment

      • Evertjan.

        #4
        Re: Can i say OR in an if/then statement

        Tim wrote on 09 jul 2003 in microsoft.publi c.inetserver.as p.general:
        [color=blue]
        > I can only guess that you tried
        >
        > if x=5 or 10 then
        >
        > which is incorrect and should be
        >
        > if x=5 or x=10 then
        >[/color]

        And:

        if x=5 or not x>3 then

        is legal.

        --
        Evertjan.
        The Netherlands.
        (Please change the x'es to dots in my emailaddress)

        Comment

        • Mike

          #5
          Re: Can i say OR in an if/then statement

          Crispy,

          Here is a good vbscript syntax help page.



          Mike


          "crispy" <polaatx@REMO VE THIS PART yahoo.com> wrote in message
          news:n8bngvk24e gp4m75dsd30kt22 bko24egfo@4ax.c om...[color=blue]
          > I am trying to say
          >
          > if (condition) is true OR (condition) is true THEN
          >
          > Can I use OR or do ihave to break it down into an elseif statement?
          >
          > I tried OR but it does not seem to work.
          >
          > thanks. crispy[/color]


          Comment

          • TomB

            #6
            Re: Can i say OR in an if/then statement

            I strongly recommend you use brackets to keep track of things.

            if (x=1) or (x=2) then
            'x is either 1 or 2
            end if


            You'll end up going insane trying to solve order of operation bugs if you
            don't.


            "crispy" <polaatx@REMO VE THIS PART yahoo.com> wrote in message
            news:n8bngvk24e gp4m75dsd30kt22 bko24egfo@4ax.c om...[color=blue]
            > I am trying to say
            >
            > if (condition) is true OR (condition) is true THEN
            >
            > Can I use OR or do ihave to break it down into an elseif statement?
            >
            > I tried OR but it does not seem to work.
            >
            > thanks. crispy[/color]


            Comment

            • Crispy

              #7
              Re: Can i say OR in an if/then statement

              Thank you all for your help.

              crispy

              "crispy" <polaatx@REMO VE THIS PART yahoo.com> wrote in message
              news:n8bngvk24e gp4m75dsd30kt22 bko24egfo@4ax.c om...[color=blue]
              > I am trying to say
              >
              > if (condition) is true OR (condition) is true THEN
              >
              > Can I use OR or do ihave to break it down into an elseif statement?
              >
              > I tried OR but it does not seem to work.
              >
              > thanks. crispy[/color]


              Comment

              Working...