|
-
Oct 10th, 2002, 12:59 PM
#1
Thread Starter
Registered User
Trigger time based event
Hello,
Anyone knows how to trigger an event based on system time ?
For example : I want my program to do something at 01:00 AM each day.
Thanks,
Jukke
-
Oct 10th, 2002, 01:01 PM
#2
Let me in ..
What do u mean how to trigger a event.
If you want to call a function, just call a function.
If you want to call a event such as command1_click. Click event of command button. Just call it as command1_click().
-
Oct 10th, 2002, 01:02 PM
#3
Let me in ..
Or if you want to Raise a event use RaiseEvent().
-
Oct 10th, 2002, 01:05 PM
#4
Thread Starter
Registered User
Right, I can execute events by calling the sub.
Even without events, how can I make my program detect a specific time e.g. 01:00 AM and do something ?
-
Oct 10th, 2002, 01:08 PM
#5
Let me in ..
Have a timer that will fire every 1 second. Interval = 1000
In timer click event check the system date/time. if matches with your value ... do some thing.
-
Oct 10th, 2002, 01:10 PM
#6
I think every 1 sec is a bit excessive ..... maybe every 45 or 60 or even 90 seconds should do....
-
Oct 10th, 2002, 01:11 PM
#7
Thread Starter
Registered User
Why didn' I find this myself.
So easy ...
Thanks techyspecy !
-
Oct 10th, 2002, 01:14 PM
#8
Let me in ..
Originally posted by techgnome
I think every 1 sec is a bit excessive ..... maybe every 45 or 60 or even 90 seconds should do....
Not possible techngome.
Lets say he wants to check for 1:00 AM
with 30 sec. timer lets say last time timer got fired at 12:59:45 sec.
next timer will fire at 1:00:15. and he will miss the 1 o clock time.
-
Oct 10th, 2002, 01:34 PM
#9
Yes but he only misses it by 15 seconds and technically its still 1 am its just not EXACTLY with no seconds difference. And then the timer doesn't poll the system near as much making it more effective.
-
Oct 10th, 2002, 01:43 PM
#10
Thread Starter
Registered User
The trigger doesn't have to be on the second. More or less around the specified time will do the trick.
Thanks guys !
-
Oct 10th, 2002, 01:45 PM
#11
Fanatic Member
Got an idea for your prog.
You might wanna put your program in the task bar if its running for a specifyed time...
I can give ya what haz been given to me...
The taskbar code ... if your want.
Originally posted by Jukke
Why didn' I find this myself.
So easy ...
Thanks techyspecy !
-
Oct 10th, 2002, 01:56 PM
#12
So Unbanned
90 seconds could skip over 1:00
say, 12:59:50 to 1:01:20
-
Oct 10th, 2002, 02:23 PM
#13
Thats true 90 seconds could skip it, but you can still use 45 or 60 would work. Or 90 if you don't mind the extra 30 seconds.
-
Oct 10th, 2002, 02:33 PM
#14
Let me in ..
If its not a matter of seconds then he has lot of options ....
-
Oct 22nd, 2002, 10:21 PM
#15
New Member
Hey Ruku,
I've been wanting to put something together that combines both the "timer" event (like from the orig. post) combined with the "min. to sys. tray" that you mentioned.
Think I could get the "task bar" code?
Thanks,
ittybitty
BTW: this is a great board, found it not too long ago and have got a lot of useful info.
Thanks people.
-
Oct 23rd, 2002, 01:06 AM
#16
I think there is no problem with any size of timestep (30 sec or even 300 sec) if you do not check for the exact time ( = 01:00). Just check for a timeperiod that is from 01:00 to 01:00 + timestep.
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
Oct 23rd, 2002, 01:20 AM
#17
Junior Member
Suggestion again...
Well similar problems are solved as follows...
set a timer...
The timer can only time for about 60,000 ms (1 minute)
set the delay time to one of the following:
- another minute if the time you want is MORE than a minute away...
- the number of seconds left untill that time
This will get you exactly where you want...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|