tmrScriptTimer.Interval Question...
Moderator: Moderators
tmrScriptTimer.Interval Question...
60000 is 1 minute. What is the maximum interval you can set for this? I'm looking to kick it off every hour. Thanks for any help in advance everybody
The maximum interval you can set seems to be 65535 milliseconds.
If you want one hour you must count the number of minute like this (this is an example)
If you want one hour you must count the number of minute like this (this is an example)
Code: Select all
Dim iNbMinutes ' declare a global variable in the top of your script
Sub Main()
tmrScriptTimer.Interval = 60000 ' one minute
tmrScriptTimer.Enabled = true ' launch the timer
End Sub
Sub tmrScriptTimer_Timer ()
iNbMinutes = int(iNbMinutes ) + 1
If Int(iNbMinutes) > 60 Then ' every hour
' Execute the code you want
End If
End Sub
Thanks Atomic!!
I was trying tmrScriptTimer.Interval = 3600000
And any code I had after the line was not being executed. I then switched this to the last line in Main, and it seems to work, I was getting my test message every hour in the hub (for past two hours).
I like your idea much better, who knows what will happen with a huge number like above over long periods of time. Off to change the code
I was trying tmrScriptTimer.Interval = 3600000
And any code I had after the line was not being executed. I then switched this to the last line in Main, and it seems to work, I was getting my test message every hour in the hub (for past two hours).
I like your idea much better, who knows what will happen with a huge number like above over long periods of time. Off to change the code