Timer control with interval > 60 seconds 
Author Message
 Timer control with interval > 60 seconds

Does anyone know of a Timer control replacement that handles an interval of

Quote:
>65,535 ms?

--
Gordon Durnell
Applied Digital Solutions of Missouri



Mon, 06 May 2002 03:00:00 GMT  
 Timer control with interval > 60 seconds
GD,

I don't know how to cause the Timer1_Timer( ) event handler to be called at a
greater time interval, but you can just let it fire off every 60000
milliseconds, and then have a Static variable counter in your Timer1_Timer( )
function that decides when it's time to do the action you desire.  The
following example assumes you set the Timer1.Interval to 60000):

Private Sub Timer1_Timer()

    Static MinuteCounter as Long

   Timer1.Enabled = False           ' prevent re-entry to this function by
temporarily disabling timer

    MinuteCounter = MinuteCounter + 1            ' increment the minute counter

    If  (MinuteCounter >= 30) Then

        ' Do tasks that need to occur every 30 minutes.
        ' ...
        ' ...
        ' ...

        MinuteCounter = 0                        ' reset the minute counter

    End If

    ' Re-enable the timer:
    Timer1.Enabled = True

End Sub

= = = = = = = = = = = = = = = = = = =

Hope this is what you were looking for...

-Dave

Quote:

> Does anyone know of a Timer control replacement that handles an interval of
> >65,535 ms?

> --
> Gordon Durnell
> Applied Digital Solutions of Missouri




Mon, 06 May 2002 03:00:00 GMT  
 Timer control with interval > 60 seconds

Quote:

>Does anyone know of a Timer control replacement that handles an interval of
>>65,535 ms?

In addition to the Static variable method that was mentioned, you can also
use the XTimer project (part of the Coffee sample program) for a timer
"control" that does not need a form and takes a long integer as a time
argument.

Frank Carr



Tue, 07 May 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help with Timer Control (interval > 10 minutes)

2. Quary timeout after 60 seconds

3. Close msgbox after 60 seconds

4. Close msgbox after 60 seconds

5. Pausing app operation for over 60 seconds

6. Close msgbox after 60 seconds

7. Close msgbox after 60 seconds

8. Timer Interval > 64 secs

9. Why does 24*60*60 = overflow ?

10. 7 * 24 * 60 * 60 = OverFlow !?

11. LOOKUP BOX > 60 OBJECTS-NO SCROLL

12. Timer interval is depending on code in timer event

 

 
Powered by phpBB® Forum Software