I'm trying to write some code that will read the clocktime. When it hits a predetermined time, I want it to run a routine. I know how to do this in VB.net. It would be done like this:
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick If TimeOfDay = "10:01:00 PM" Then 'Go do something important End If End Sub
Unfortunately I don't know the equivalent to the same in vbScript (if there is something like it).
I did find a "timer" online that counts the number of seconds from midnight. It looks like this:
Function TimeIt(N) Dim StartTime, EndTime StartTime = Timer For I = 1 To N Next EndTime = Timer TimeIt = EndTime - StartTime End Function
However I'm not sure how to use this. So my questions are:
1) What is the "(N)" representing (better, what is "N")? I see it used in the loop.
2) When using a "Function", how is it called within your primary sub-routine?
If you have a better code suggestion to do what I want to do, I'm all ears!
In reading, I gather that vbScript is similar to VB6. Thus the reason for posting here. If there is a better forum to send this to, please direct me.
In advance, thanks for any assistance.