473,671 Members | 2,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Easy Value Compare Question

Y2K
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

Aug 8 '06 #1
10 1228
Dim A, B as String

A = textbox1.text
B = textbox2.text

If Not A = B Then A = B

"Y2K" <y2******@gmail .comwrote in message
news:11******** **************@ 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

Aug 8 '06 #2
Y2K
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" <y2******@gmail .comwrote in message
news:11******** **************@ 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
Aug 8 '06 #3
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" <y2******@gmail .comwrote in message
news:11******** **************@ 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
>

Aug 8 '06 #4
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" <y2******@gmail .comwrote in message
news:11******** *************@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" <y2******@gmail .comwrote in message
news:11******* *************** @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

Aug 8 '06 #5
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" <y2******@gmail .comwrote in message
news:11******** **************@ 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
>

Aug 8 '06 #6
Y2K
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" <y2******@gmail .comwrote in message
news:11******** **************@ 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
Aug 8 '06 #7
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" <y2******@gmail .comwrote in message
news:11***** *************** **@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
>

Aug 9 '06 #8
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" <gh*******@gmai l.comschreef in bericht
news:be******** *************** ***@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" <y2******@gmail .comwrote in message
news:11**** *************** ***@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
>>


Aug 9 '06 #9
Y2K
-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" <y2******@gmail .comwrote in message
news:11****** *************** *@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
Aug 9 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1359
by: ben3003 | last post by:
I am only asking for my code to do a simple thing but for some reason i just can't get it to do what i want it to do... it been bugging me all day! The user inputs 2 dates on one page. in the form xx/xx/xxxx I then want the output page to display the amount of days that there are between these two dates, inclusive. For example: 01/01/2005 03/01/2005
9
6502
by: Russ Perry Jr | last post by:
I'm using "ID" and "Value" in the generic sense here... Let's say one page I had a <html:select> with a collection like this: <html:options collection="items" property="key" labelProperty="value"/> In this case "key" is what I mean by "ID", and "value" is what I mean by "Value" -- the "Value" is shown to the user, but the "ID" is what I plan to keep, to be saved to a database (as a reference in a table to a common table as a part of...
2
1476
by: FLEB | last post by:
Okay, so I've got this XML: <qa> <questionset> <question name="yourname">What is your name?</question> <question name="yourquest">What is your quest?</question> <question name="favcolor"> What is your favorite color?</question> </questionset> <answerset time="some_unique_time"> <answer question="yourname">FLEB the Amazing</answer>
4
5409
by: John Vottero | last post by:
When a class contains a TimeSpan property, XmlSerializer doesn't work. A TimeSpan property is serialized like: <MySpan /> I've read a number of posts that talk about why this happens and how to work around it. My question is from a slightly different angle. What can I do to my value type structures so that XmlSerializer can serialize them properly?
18
39991
by: Mike Bartels | last post by:
Hi Everyone! I have two Arrays A and B. Both arrays are byte arrays with 7 bytes each. The contents of array A and B are the same A = {1, 2, 3, 4, 5, 6, 7}; B = {1, 2, 3, 4, 5, 6, 7}; When I do
19
2645
by: Dennis | last post by:
I have a public variable in a class of type color declared as follows: public mycolor as color = color.Empty I want to check to see if the user has specified a color like; if mycolor = Color.Empty then..... or if mycolor is Color.Empty then .......
9
5259
by: Steven | last post by:
Hello, I have a question about strcmp(). I have four words, who need to be compared if it were two strings. I tried adding the comparison values like '(strcmp(w1, w2) + strcmp(w3, w4))', where w1 and w2 make up the first string and, w3 and w4 make up the second string. I do not want to allocate memory, then put the words together to create a string only to facilitate strcmp() comparison. My question; Does anyone know how to get the...
0
4261
by: Zark3 | last post by:
Hi all, In a web form I use a for loop to dynamically add TextBox'es to a page (one for each item in an input file). I can get the input values and I can display them in Label's and TextBox'es. That part works. However, my problem is that the form lets the user choose from input files; the labels are updated, the textboxes are not. This seems to me like it is a ViewState issue, I just can't figure out how to fix that... Apparently the...
26
2443
by: Ping | last post by:
Hi, I'm wondering if it is useful to extend the count() method of a list to accept a callable object? What it does should be quite intuitive: count the number of items that the callable returns True or anything logically equivalent (non-empty sequence, non-zero number, etc). This would return the same result as len(filter(a_callable, a_list)), but without constructing an intermediate list which is thrown away after len() is done.
0
8390
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8819
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8597
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8667
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7428
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5692
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2808
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.