Re: Final Word (?) on Timers



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)
Dim Finish As Variant

Finish = DateAdd("s", NbSec, Now)
DoEvents
Do Until Now > Finish
WaitMessage ' API
DoEvents
Loop
End Sub

Also add a Timer that simply acts as a message pump, kicking the App
out of WaitMessage every few seconds


--
Steve Kelley
.



Relevant Pages

  • Re: EWF RAM
    ... Yes, the timer was for grins, I could do away with it. ... Since this is being done from a batch file on a remote laptop, ... > By commit you mean perform commin of EWF, ...
    (microsoft.public.windowsxp.embedded)
  • Re: MFC beginner question
    ... set a timer for 5 sec and then hide/destroy ... the splash screen and execute your batch file. ...
    (microsoft.public.vc.mfc)
  • Re: do pop up boxes stop all events?
    ... You can "get out of there" in just a few microseconds and the next event will still not occur on the next 10 millisecond interval on most machines. ... The fact is that the underlying sytem which triggers the VB Timer does not really get a very high priority and the OS doesn't really consider such timings to be important. ... Private Declare Function timeBeginPeriod _ ... Private Sub Form_Unload ...
    (microsoft.public.vb.general.discussion)
  • RE: Timer updated on form
    ... Since we need to keep the timer running while the form is ... is in progress and we update the time display; ... I don't see two Private Sub From_Timerevents. ... This variable will tell the Timer event to update the time display ...
    (microsoft.public.access.formscoding)
  • Re: Multiple Timer Advice
    ... user only talks on the phone for 10 minutes so once done, the timer can be ... > Private Const NumOfPhones As Long = 10 ... > Dim OldCaption As String ... > Private Sub ColorButton ...
    (microsoft.public.vb.general.discussion)