|
-
Aug 9th, 2000, 06:32 PM
#1
Thread Starter
New Member
Is there a way to reset the timer interval without waiting for the full interval the elaps before the changes are made?
First i tried
tmr.Enable = False
tmr.Enable = True
However, I found that this only works some times but not all the time... and now for some odd reason, it don't work at all to reset the interval right away! Any Ideas?
Another thing, is there a way to force a small piece of code (2 or 3 lines) to execute one after another without having the timer event interupting it? So wait until it finishes those 2 lines before going into the timer event?
Thanx in advance...
-
Aug 9th, 2000, 06:36 PM
#2
Thread Starter
New Member
So can i temporarily disable the timer and after the 2 lines, enable it again... will it still remember the timer interval? or can i retreive the remaining interval before disabling it then set the interval back in?
-
Aug 9th, 2000, 07:20 PM
#3
Junior Member
Timer
The Enabled property should work for this. I haven't had any problem like this.(Try using a "refresh" method immediately after changing the property.)
For the second, in the timer event you can disable the timer control until the timer procedure finishs. When the code in the timer event is done, Enable it again. You could also check the state of a global variable to temporarily disable the timer procedure(or delay it.).
-
Aug 9th, 2000, 07:24 PM
#4
transcendental analytic
Timer is very inaccurate, upto 53 milliseconds so anything could cause the intervals won't work but the event won't fire within code unless you have a doevents statement. Also your event's will stop firing as soon as you turn it of but it won't exit the event for that sake
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Aug 9th, 2000, 07:32 PM
#5
To exit a Timer interval without having it finish, you can use Exit Sub.
Code:
Private Sub Timer1_Timer()
Timer1.Enabled = False
Exit Sub '**The Sub ends here**
Print "End of Sub"
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|