Easy Value Compare Question

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

    #1

    Easy Value Compare Question

    Any suggestions to compare two values, and if either value changes,
    then both values now become the changed values. Right now I'm doing it
    with a textbox and onchange event, but would like to get rid of the
    textbox and use internal variables.

    TIA

  • Scott M.

    #2
    Re: Easy Value Compare Question

    Dim A, B as String

    A = textbox1.text
    B = textbox2.text

    If Not A = B Then A = B



    "Y2K" <y2khines@gmail .comwrote in message
    news:1155061263 .587120.263920@ m79g2000cwm.goo glegroups.com.. .
    Any suggestions to compare two values, and if either value changes,
    then both values now become the changed values. Right now I'm doing it
    with a textbox and onchange event, but would like to get rid of the
    textbox and use internal variables.
    >
    TIA
    >

    Comment

    • Y2K

      #3
      Re: Easy Value Compare Question

      Scott,

      Thanks for the reply, but that's not going to work, as it's only
      comparing A to B and making A equal to B.

      I need to compare both, and make each value the same as the last
      changed value.


      Scott M. wrote:
      Dim A, B as String
      >
      A = textbox1.text
      B = textbox2.text
      >
      If Not A = B Then A = B
      >
      >
      >
      "Y2K" <y2khines@gmail .comwrote in message
      news:1155061263 .587120.263920@ m79g2000cwm.goo glegroups.com.. .
      Any suggestions to compare two values, and if either value changes,
      then both values now become the changed values. Right now I'm doing it
      with a textbox and onchange event, but would like to get rid of the
      textbox and use internal variables.

      TIA

      Comment

      • Terry

        #4
        Re: Easy Value Compare Question

        You need to keep a third value:
        A=B=C

        and then when you need to do your check ....
        If A <C then
        C = A
        B = A
        elseif B <C then
        C = B
        A = B
        endif



        --
        Terry


        "Y2K" wrote:
        Scott,
        >
        Thanks for the reply, but that's not going to work, as it's only
        comparing A to B and making A equal to B.
        >
        I need to compare both, and make each value the same as the last
        changed value.
        >
        >
        Scott M. wrote:
        Dim A, B as String

        A = textbox1.text
        B = textbox2.text

        If Not A = B Then A = B



        "Y2K" <y2khines@gmail .comwrote in message
        news:1155061263 .587120.263920@ m79g2000cwm.goo glegroups.com.. .
        Any suggestions to compare two values, and if either value changes,
        then both values now become the changed values. Right now I'm doing it
        with a textbox and onchange event, but would like to get rid of the
        textbox and use internal variables.
        >
        TIA
        >
        >
        >

        Comment

        • Scott M.

          #5
          Re: Easy Value Compare Question

          Compare both what? If you compare A against B, what else is there to
          compare?

          And make each value the same as what's last changed value?

          Could you be more clear on what you need? This seems like simple If...Then
          logic.

          "Y2K" <y2khines@gmail .comwrote in message
          news:1155066136 .617192.50220@b 28g2000cwb.goog legroups.com...
          Scott,
          >
          Thanks for the reply, but that's not going to work, as it's only
          comparing A to B and making A equal to B.
          >
          I need to compare both, and make each value the same as the last
          changed value.
          >
          >
          Scott M. wrote:
          >Dim A, B as String
          >>
          >A = textbox1.text
          >B = textbox2.text
          >>
          >If Not A = B Then A = B
          >>
          >>
          >>
          >"Y2K" <y2khines@gmail .comwrote in message
          >news:115506126 3.587120.263920 @m79g2000cwm.go oglegroups.com. ..
          Any suggestions to compare two values, and if either value changes,
          then both values now become the changed values. Right now I'm doing it
          with a textbox and onchange event, but would like to get rid of the
          textbox and use internal variables.
          >
          TIA
          >
          >

          Comment

          • Terry

            #6
            Re: Easy Value Compare Question

            And...
            You could create a class, with two string properties and when you set
            one, the other changes also.
            --
            Terry


            "Y2K" wrote:
            Scott,
            >
            Thanks for the reply, but that's not going to work, as it's only
            comparing A to B and making A equal to B.
            >
            I need to compare both, and make each value the same as the last
            changed value.
            >
            >
            Scott M. wrote:
            Dim A, B as String

            A = textbox1.text
            B = textbox2.text

            If Not A = B Then A = B



            "Y2K" <y2khines@gmail .comwrote in message
            news:1155061263 .587120.263920@ m79g2000cwm.goo glegroups.com.. .
            Any suggestions to compare two values, and if either value changes,
            then both values now become the changed values. Right now I'm doing it
            with a textbox and onchange event, but would like to get rid of the
            textbox and use internal variables.
            >
            TIA
            >
            >
            >

            Comment

            • Y2K

              #7
              Re: Easy Value Compare Question

              Perfect! Thanks Terry. Knew there was an indirect var needed
              somewhere. Works as expected.


              Terry wrote:
              You need to keep a third value:
              A=B=C
              >
              and then when you need to do your check ....
              If A <C then
              C = A
              B = A
              elseif B <C then
              C = B
              A = B
              endif
              >
              >
              >
              --
              Terry
              >
              >
              "Y2K" wrote:
              >
              Scott,

              Thanks for the reply, but that's not going to work, as it's only
              comparing A to B and making A equal to B.

              I need to compare both, and make each value the same as the last
              changed value.


              Scott M. wrote:
              Dim A, B as String
              >
              A = textbox1.text
              B = textbox2.text
              >
              If Not A = B Then A = B
              >
              >
              >
              "Y2K" <y2khines@gmail .comwrote in message
              news:1155061263 .587120.263920@ m79g2000cwm.goo glegroups.com.. .
              Any suggestions to compare two values, and if either value changes,
              then both values now become the changed values. Right now I'm doing it
              with a textbox and onchange event, but would like to get rid of the
              textbox and use internal variables.

              TIA

              Comment

              • GhostInAK

                #8
                Re: Easy Value Compare Question

                Hello Y2K,

                You have got to be kidding.

                -Boo
                Perfect! Thanks Terry. Knew there was an indirect var needed
                somewhere. Works as expected.
                >
                Terry wrote:
                >
                >You need to keep a third value:
                >A=B=C
                >and then when you need to do your check ....
                >If A <C then
                >C = A
                >B = A
                >elseif B <C then
                >C = B
                >A = B
                >endif
                >--
                >Terry
                >"Y2K" wrote:
                >>
                >>Scott,
                >>>
                >>Thanks for the reply, but that's not going to work, as it's only
                >>comparing A to B and making A equal to B.
                >>>
                >>I need to compare both, and make each value the same as the last
                >>changed value.
                >>>
                >>Scott M. wrote:
                >>>
                >>>Dim A, B as String
                >>>>
                >>>A = textbox1.text
                >>>B = textbox2.text
                >>>If Not A = B Then A = B
                >>>>
                >>>"Y2K" <y2khines@gmail .comwrote in message
                >>>news:1155061 263.587120.2639 20@m79g2000cwm. googlegroups.co m...
                >>>>Any suggestions to compare two values, and if either value
                >>>>changes, then both values now become the changed values. Right
                >>>>now I'm doing it with a textbox and onchange event, but would like
                >>>>to get rid of the textbox and use internal variables.
                >>>>>
                >>>>TIA
                >>>>>

                Comment

                • Cor Ligthert [MVP]

                  #9
                  Re: Easy Value Compare Question

                  Boo,

                  I had something the same with a problem my wife had yesterday. For most of
                  us (developing for a long time), logical thinking in this way is a second
                  nature, not all people are trained to think logical in this way and often
                  find it crazy as we do it and it takes than a long time to learn that.

                  That is probably why we sometimes don't understand people who don't do
                  computer development, because things are in our eyes often so logical..

                  Just my thought,

                  :-)

                  Cor

                  "GhostInAK" <ghostinak@gmai l.comschreef in bericht
                  news:be1391bf12 b6d8c8893516b5c 163@news.micros oft.com...
                  Hello Y2K,
                  >
                  You have got to be kidding.
                  >
                  -Boo
                  >
                  >Perfect! Thanks Terry. Knew there was an indirect var needed
                  >somewhere. Works as expected.
                  >>
                  >Terry wrote:
                  >>
                  >>You need to keep a third value:
                  >>A=B=C
                  >>and then when you need to do your check ....
                  >>If A <C then
                  >>C = A
                  >>B = A
                  >>elseif B <C then
                  >>C = B
                  >>A = B
                  >>endif
                  >>--
                  >>Terry
                  >>"Y2K" wrote:
                  >>>
                  >>>Scott,
                  >>>>
                  >>>Thanks for the reply, but that's not going to work, as it's only
                  >>>comparing A to B and making A equal to B.
                  >>>>
                  >>>I need to compare both, and make each value the same as the last
                  >>>changed value.
                  >>>>
                  >>>Scott M. wrote:
                  >>>>
                  >>>>Dim A, B as String
                  >>>>>
                  >>>>A = textbox1.text
                  >>>>B = textbox2.text
                  >>>>If Not A = B Then A = B
                  >>>>>
                  >>>>"Y2K" <y2khines@gmail .comwrote in message
                  >>>>news:115506 1263.587120.263 920@m79g2000cwm .googlegroups.c om...
                  >>>>>Any suggestions to compare two values, and if either value
                  >>>>>changes, then both values now become the changed values. Right
                  >>>>>now I'm doing it with a textbox and onchange event, but would like
                  >>>>>to get rid of the textbox and use internal variables.
                  >>>>>>
                  >>>>>TIA
                  >>>>>>
                  >
                  >

                  Comment

                  • Y2K

                    #10
                    Re: Easy Value Compare Question

                    -Boo

                    Thanks for that helpful post. That attitude should take you far in
                    life.

                    GhostInAK wrote:
                    Hello Y2K,
                    >
                    You have got to be kidding.
                    >
                    -Boo
                    >
                    Perfect! Thanks Terry. Knew there was an indirect var needed
                    somewhere. Works as expected.

                    Terry wrote:
                    You need to keep a third value:
                    A=B=C
                    and then when you need to do your check ....
                    If A <C then
                    C = A
                    B = A
                    elseif B <C then
                    C = B
                    A = B
                    endif
                    --
                    Terry
                    "Y2K" wrote:
                    >
                    >Scott,
                    >>
                    >Thanks for the reply, but that's not going to work, as it's only
                    >comparing A to B and making A equal to B.
                    >>
                    >I need to compare both, and make each value the same as the last
                    >changed value.
                    >>
                    >Scott M. wrote:
                    >>
                    >>Dim A, B as String
                    >>>
                    >>A = textbox1.text
                    >>B = textbox2.text
                    >>If Not A = B Then A = B
                    >>>
                    >>"Y2K" <y2khines@gmail .comwrote in message
                    >>news:11550612 63.587120.26392 0@m79g2000cwm.g ooglegroups.com ...
                    >>>Any suggestions to compare two values, and if either value
                    >>>changes, then both values now become the changed values. Right
                    >>>now I'm doing it with a textbox and onchange event, but would like
                    >>>to get rid of the textbox and use internal variables.
                    >>>>
                    >>>TIA
                    >>>>

                    Comment

                    • GhostInAK

                      #11
                      Re: Easy Value Compare Question

                      Hello Y2K,

                      You're welcome. Your lazyness and/or idiocy will probably kill you ealy
                      in life.

                      -Boo
                      -Boo
                      >
                      Thanks for that helpful post. That attitude should take you far in
                      life.
                      >
                      GhostInAK wrote:
                      >
                      >Hello Y2K,
                      >>
                      >You have got to be kidding.
                      >>
                      >-Boo
                      >>
                      >>Perfect! Thanks Terry. Knew there was an indirect var needed
                      >>somewhere. Works as expected.
                      >>>
                      >>Terry wrote:
                      >>>
                      >>>You need to keep a third value:
                      >>>A=B=C
                      >>>and then when you need to do your check ....
                      >>>If A <C then
                      >>>C = A
                      >>>B = A
                      >>>elseif B <C then
                      >>>C = B
                      >>>A = B
                      >>>endif
                      >>>--
                      >>>Terry
                      >>>"Y2K" wrote:
                      >>>>Scott,
                      >>>>>
                      >>>>Thanks for the reply, but that's not going to work, as it's only
                      >>>>comparing A to B and making A equal to B.
                      >>>>>
                      >>>>I need to compare both, and make each value the same as the last
                      >>>>changed value.
                      >>>>>
                      >>>>Scott M. wrote:
                      >>>>>
                      >>>>>Dim A, B as String
                      >>>>>>
                      >>>>>A = textbox1.text
                      >>>>>B = textbox2.text
                      >>>>>If Not A = B Then A = B
                      >>>>>"Y2K" <y2khines@gmail .comwrote in message
                      >>>>>news:11550 61263.587120.26 3920@m79g2000cw m.googlegroups. com...
                      >>>>>>Any suggestions to compare two values, and if either value
                      >>>>>>changes , then both values now become the changed values. Right
                      >>>>>>now I'm doing it with a textbox and onchange event, but would
                      >>>>>>like to get rid of the textbox and use internal variables.
                      >>>>>>>
                      >>>>>>TIA
                      >>>>>>>

                      Comment

                      Working...