There are different ways to approach this based on your actuall requirement.
-- You can use a timer and make the timer active when x=1 and inactive when its not.
-- else you can use the sleep and then resume when the value of x changes.
Both methods depends on where you use it.
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
Offline 645 posts
since Dec 2006