Re: Final Word (?) on Timers
- From: Steve Kelley <skelley@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 25 Apr 2007 08:44:53 -0500
Yet another option is to have a timer on the form and set the time out value to 120000(ms) and enable it when the first batch file runs and run the second batch file when the timer fires. You can disable your UI elements to keep the user from interacting with your form until the second batch file runs if needed. This way your system is not at all tied down by any loop. This isn't technically a pause because your program can keep processing after the timer is enabled but depending on you your code is structured this may be OK.
Private Sub Command1_Click()
Label1.Caption = "Timer is running"
' Disable any UI elements you need to
Command1.Enabled = False
DelayTimer.Enabled = True
' Run batch file 1
End Sub
Private Sub DelayTimer_Timer()
DelayTimer.Enabled = False
' re-enable any UI elements you need to
Command1.Enabled = True
Label1.Caption = "Timer is done"
' Run batch file 2
End Sub
J French wrote:
On Tue, 24 Apr 2007 19:29:45 GMT, "John Blessing"
<blessij@**REMOVE**THIS**gmail.com> wrote:
Public Sub Pause(NbSec As Single)WaitMessage ' API
Dim Finish As Variant
Finish = DateAdd("s", NbSec, Now)
DoEvents
Do Until Now > Finish
DoEventsLoop
End Sub
Also add a Timer that simply acts as a message pump, kicking the App
out of WaitMessage every few seconds
--
Steve Kelley
.
- Follow-Ups:
- Re: Final Word (?) on Timers
- From: Rick Rothstein \(MVP - VB\)
- Re: Final Word (?) on Timers
- From: J French
- Re: Final Word (?) on Timers
- References:
- Final Word (?) on Timers
- From: termv
- Re: Final Word (?) on Timers
- From: John Blessing
- Re: Final Word (?) on Timers
- From: J French
- Final Word (?) on Timers
- Prev by Date: Re: Scaling a picture (i.e. Bitmap or JPG) question...
- Next by Date: Re: Final Word (?) on Timers
- Previous by thread: Re: Final Word (?) on Timers
- Next by thread: Re: Final Word (?) on Timers
- Index(es):
Relevant Pages
|