Click here to Skip to main content
13,347,462 members (51,455 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello Everyone,
If i have an event that happens always,
Application.Idle += Myevent;

and if there is a variable that changes every time in this event,
   var = value;

How can i capture old value and new value of this variable and then compare between,

Thanks in advance,
Posted 21-Jan-13 7:46am
Updated 21-Jan-13 7:47am
richcb 21-Jan-13 12:48pm
Use a session variable to capture the first one and compare that to the second one after taking it back out of session.
Richard MacCutchan 21-Jan-13 12:48pm
What is var and where does value come from?
Sergey Alexandrovich Kryukov 21-Jan-13 12:49pm
Not clear. The code you show will not compile, anyway...
z3ngew 21-Jan-13 12:51pm
This is not my code, this is an emulation of it
Andreas Gieriet 21-Jan-13 13:07pm
Please be so nice and take the time and make it a somehow working version - or do you expect us to spend that time for you?
z3ngew 21-Jan-13 13:18pm
you are correct, thanks
Andreas Gieriet 21-Jan-13 13:25pm
The quality of the question is too low and you seem to be ignorant on requests to improve. My 1.
Sergey Alexandrovich Kryukov 21-Jan-13 15:22pm
Sorry, no. "Emulation" means something totally different. Not a valid question, honestly.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1


Try this:
int oldVar = aVar; // I use int in this example
                   // I also use aVar instead of var, because var is a keyword
int newVar = value;
// compare

aVariable = newVar;

Hope this helps.
Marcus Kramer 21-Jan-13 13:45pm
My 5
ProgramFOX 21-Jan-13 13:57pm
Thank you!
Andreas Gieriet 21-Jan-13 15:21pm
My 5. What else to answer to the given question?
ProgramFOX 22-Jan-13 12:36pm
Thank you!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.180111.1 | Last Updated 21 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100