timer - interval

wild wolf
10-29-2001, 10:54 PM
cant the time interval for a timer be greater than 10000? if it can, then how coz it gives me an error saying value is too big

10-29-2001, 11:10 PM
65535 is the maximum number. I am not sure why you can't go higher than 10000. I suspect something else is going on.

wild wolf
10-29-2001, 11:43 PM
if i wanted the interval to be more than 65535? say llike 100000

10-29-2001, 11:53 PM
You could just set the interval to 50000 and have a counter keep track of the interval until it reached 2. Then you would know that 100000 miliseconds have past.

This example has the interval set to 1000 (one second) so you can see it work faster. All you would have to do is change it to 50000 and you would get 100000 out of it.

<pre><font color=blue>Option Explicit</font color=blue>

<font color=blue>Private Sub</font color=blue> Form_Load()

Timer1.Interval = 1000 <font color=green>'one second</font color=green>

<font color=blue>End Sub</font color=blue>

<font color=blue>Private Sub</font color=blue> Timer1_Timer()

<font color=blue>Static</font color=blue> intTime <font color=blue>As Integer</font color=blue>

intTime = intTime + 1

<font color=blue>If</font color=blue> intTime = 2 <font color=blue>Then</font color=blue>
<font color=green>'run some code here</font color=green>
Me.Print "Two intervals have passed"
intTime = 0 <font color=green>'reset counter</font color=green>
<font color=blue>End If</font color=blue>

<font color=blue>End Sub</font color=blue></pre>

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum