473,387 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Event Handler on INT variable watching for value?

Hi,

Is there a way to create an event handler on variable and watch for a
specified value to occour?

Let's say i want a method executed when value of x = 10 and x=15

Thanks
Nov 17 '05 #1
4 1433
No, the handler will always fire. But inside, you can look at the value and
just do nothing if the value is not acceptable.

"Peter Styk" <il***@dobrebopolskie.NoNoNo.com> wrote in message
news:ez**************@TK2MSFTNGP10.phx.gbl...
Hi,

Is there a way to create an event handler on variable and watch for a
specified value to occour?

Let's say i want a method executed when value of x = 10 and x=15

Thanks

Nov 17 '05 #2
Ok, but how exactly would you do that in C#?


"Marina" <so*****@nospam.com> wrote in message
news:e8**************@TK2MSFTNGP10.phx.gbl...
No, the handler will always fire. But inside, you can look at the value
and just do nothing if the value is not acceptable.

"Peter Styk" <il***@dobrebopolskie.NoNoNo.com> wrote in message
news:ez**************@TK2MSFTNGP10.phx.gbl...
Hi,

Is there a way to create an event handler on variable and watch for a
specified value to occour?

Let's say i want a method executed when value of x = 10 and x=15

Thanks


Nov 17 '05 #3
You would use an if statement to see if the value of the variable matches
your criteria, and only then do something.

If you are looking for anything more specific, it's impossible to say. Your
question was quite vague.

"Peter Styk" <il***@dobrebopolskie.NoNoNo.com> wrote in message
news:em**************@TK2MSFTNGP14.phx.gbl...
Ok, but how exactly would you do that in C#?


"Marina" <so*****@nospam.com> wrote in message
news:e8**************@TK2MSFTNGP10.phx.gbl...
No, the handler will always fire. But inside, you can look at the value
and just do nothing if the value is not acceptable.

"Peter Styk" <il***@dobrebopolskie.NoNoNo.com> wrote in message
news:ez**************@TK2MSFTNGP10.phx.gbl...
Hi,

Is there a way to create an event handler on variable and watch for a
specified value to occour?

Let's say i want a method executed when value of x = 10 and x=15

Thanks



Nov 17 '05 #4
Peter Styk <il***@dobrebopolskie.NoNoNo.com> wrote:
Is there a way to create an event handler on variable and watch for a
specified value to occour?

Let's say i want a method executed when value of x = 10 and x=15


That sounds like a good case for using a property.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #5

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

Similar topics

3
by: R Millman | last post by:
under ASP.NET, single stepping in debug mode appears not to stop within event procedures. i.e. 1) Create web page with submit button and event procedure for the click event in the code behind...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
4
by: mflll | last post by:
I am looking into the different techniques of handling arrays of edit boxes in Java Script. The first program below works fine. However, are there better ways of doing this, where the person...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.