Loading ...
Sorry, an error occurred while loading the content.
 

understanding evaluations - if not working

Expand Messages
  • Noah
    Hi Okay I cant seem to figure out why the following if statement is not working. The following evaluation is considering the variables a match and is
    Message 1 of 7 , Sep 2 9:39 AM
      Hi

      Okay I cant seem to figure out why the following 'if' statement is not
      working. The following evaluation is considering the variables a match
      and is entering the brackets. From my perspective they are not a match.
      what am I doing wrong?


      $community_subname = AS9633-AGGS_mcast;
      $loop_subname = AS9633-AGGS;


      if ( $community_subname == "$loop_subname" ) {
      is considering the above variables a match is entering the brackets.
      }


      cheers,

      Noah



      [Non-text portions of this message have been removed]
    • Chad Perrin
      ... You need to quote your strings. ... You also need to use the string comparison operator, eq , rather than the numeric comparison operator, == . -- CCD
      Message 2 of 7 , Sep 2 10:49 AM
        On Sat, Sep 02, 2006 at 09:39:37AM -0700, Noah wrote:
        > Hi
        >
        > Okay I cant seem to figure out why the following 'if' statement is not
        > working. The following evaluation is considering the variables a match
        > and is entering the brackets. From my perspective they are not a match.
        > what am I doing wrong?
        >
        > $community_subname = AS9633-AGGS_mcast;
        > $loop_subname = AS9633-AGGS;

        You need to quote your strings.


        >
        > if ( $community_subname == "$loop_subname" ) {
        > is considering the above variables a match is entering the brackets.
        > }

        You also need to use the string comparison operator, "eq", rather than
        the numeric comparison operator, "==".

        --
        CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
        "The ability to quote is a serviceable
        substitute for wit." - W. Somerset Maugham
      • Noah
        ... Hi, okay did that. the strings are in quotes now. ... I am using the eq operator that didnt help either. any other clues? cheers, Noah [Non-text portions
        Message 3 of 7 , Sep 2 1:47 PM
          Chad Perrin wrote:
          > On Sat, Sep 02, 2006 at 09:39:37AM -0700, Noah wrote:
          >
          >> Hi
          >>
          >> Okay I cant seem to figure out why the following 'if' statement is not
          >> working. The following evaluation is considering the variables a match
          >> and is entering the brackets. From my perspective they are not a match.
          >> what am I doing wrong?
          >>
          >> $community_subname = AS9633-AGGS_mcast;
          >> $loop_subname = AS9633-AGGS;
          >>
          >
          > You need to quote your strings.
          >


          Hi,

          okay did that. the strings are in quotes now.
          >
          >
          >> if ( $community_subname == "$loop_subname" ) {
          >> is considering the above variables a match is entering the brackets.
          >> }
          >>
          >
          > You also need to use the string comparison operator, "eq", rather than
          > the numeric comparison operator, "==".
          >
          >


          I am using the eq operator that didnt help either. any other clues?



          cheers,
          Noah



          [Non-text portions of this message have been removed]
        • Noah
          ... actually I was reading things wrong. the comparison is working fine. thanks, Cheers, Noah [Non-text portions of this message have been removed]
          Message 4 of 7 , Sep 2 1:51 PM
            >
            >
            >
            >> if ( $community_subname == "$loop_subname" ) {
            >> is considering the above variables a match is entering the brackets.
            >> }
            >>
            >
            > You also need to use the string comparison operator, "eq", rather than
            > the numeric comparison operator, "==".
            >
            >


            actually I was reading things wrong. the comparison is working fine.

            thanks,

            Cheers,

            Noah



            [Non-text portions of this message have been removed]
          • Paul Archer
            Turn on warnings, and you ll have your answer. *Always* turn on warnings, and you ll have your answer much more often. Paul ... As to Jesus of Nazareth...I
            Message 5 of 7 , Sep 2 6:25 PM
              Turn on warnings, and you'll have your answer.
              *Always* turn on warnings, and you'll have your answer much more often.

              Paul


              9:39am, Noah wrote:

              > Hi
              >
              > Okay I cant seem to figure out why the following 'if' statement is not
              > working. The following evaluation is considering the variables a match
              > and is entering the brackets. From my perspective they are not a match.
              > what am I doing wrong?
              >
              >
              > $community_subname = AS9633-AGGS_mcast;
              > $loop_subname = AS9633-AGGS;
              >
              >
              > if ( $community_subname == "$loop_subname" ) {
              > is considering the above variables a match is entering the brackets.
              > }
              >
              >
              > cheers,
              >
              > Noah
              >
              >
              >
              > [Non-text portions of this message have been removed]
              >
              >
              >
              > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
              > Yahoo! Groups Links
              >
              >
              >
              >
              >
              >



              ----------------------------------------------------------------
              As to Jesus of Nazareth...I think the system of Morals and his
              Religion, as he left them to us, the best the World ever saw
              or is likely to see; but I apprehend it has received various
              corrupting Changes, and I have, with most of the present
              Dissenters in England, some doubts as to his divinity.
              --------------------Benjamin Franklin---------------------------
            • Noah
              ... thanks Paul - will do. cheers, Noah
              Message 6 of 7 , Sep 2 8:52 PM
                Paul Archer wrote:
                > Turn on warnings, and you'll have your answer.
                > *Always* turn on warnings, and you'll have your answer much more often.
                >
                > Paul
                >

                thanks Paul - will do.

                cheers,

                Noah
              • Phanidhar
                Hi Noah, Please replace the operator == with eq . It will works.. Thanks, Phani. Noah wrote: Hi Okay I
                Message 7 of 7 , Sep 4 7:08 AM
                  Hi Noah,

                  Please replace the operator '==' with 'eq'. It will works..

                  Thanks,
                  Phani.

                  Noah <admin2@...> wrote: Hi

                  Okay I cant seem to figure out why the following 'if' statement is not
                  working. The following evaluation is considering the variables a match
                  and is entering the brackets. From my perspective they are not a match.
                  what am I doing wrong?

                  $community_subname = AS9633-AGGS_mcast;
                  $loop_subname = AS9633-AGGS;

                  if ( $community_subname == "$loop_subname" ) {
                  is considering the above variables a match is entering the brackets.
                  }

                  cheers,

                  Noah

                  [Non-text portions of this message have been removed]






                  ---------------------------------
                  Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1ยข/min.

                  [Non-text portions of this message have been removed]
                Your message has been successfully submitted and would be delivered to recipients shortly.