| View previous topic :: View next topic |
| Author |
Message |
kenmcn816 Newbie
Joined: 26 Mar 2003 Posts: 6
|
Posted: Sun Aug 24, 2003 12:31 am Post subject: Taskicon to run program at a certain time |
|
|
I have VDS 4 and have modified the taskicon script included in the examples folder. I can run the program correctly by right mouse clicking the icon and running it manually. But what I would really like to do would be to run a program at a certain time of day every day. I've tried writing in the loop to check for the time of day using the @DATETIME(t) event which does return the time format I need, however I can't seem to get everything to work correctly.
Any help would be great, thanks.
kenmcn816 |
|
| Back to top |
|
 |
Protected Valued Contributor


Joined: 02 Jan 2001 Posts: 228 Location: Portugal
|
Posted: Sun Aug 24, 2003 12:35 am Post subject: |
|
|
I don't think I can help you, unless you show us your script  |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Sun Aug 24, 2003 4:04 am Post subject: |
|
|
Looks like you have made some small mistake somewhere. You may consider posting the evloop and the timer event below so that some one can help you.
( I hope you have done something like this pseudocode below):
Pseudocode:
| Code: | :EVLOOP
WAIT EVENT,0.1
GOTO @EVENT()
:TIMER
REM CHECK TIME
REM IF THE TIME MATCHES YOUR REQUIREMENTS
REM RUN somename.exe
REM ELSE
REM END
REM
REM REMOVE REM AND FILL VALID COMMNADS
GOTO EVLOOP |
Hope this helps
Regrads _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Mon Aug 25, 2003 4:35 pm Post subject: |
|
|
I would use an alarm timer to accomplish this...
| Code: | REM *** set the time you want the event to happen and start the timer...
%%time = 17:00:00
TIMER START,1,ALARM,%%time
:evloop
WAIT EVENT
GOTO @EVENT()
:TIMER1ALARM
REM *** put the code you want to execute when the timer goes off here...
INFO "Time to go home!"
REM *** restart the timer to have it go off again the next day...
TIMER START,1,ALARM,%%time
GOTO evloop |
_________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
| Back to top |
|
 |
kenmcn816 Newbie
Joined: 26 Mar 2003 Posts: 6
|
Posted: Tue Aug 26, 2003 3:49 pm Post subject: |
|
|
Thank you Hortalonus, your suggestion worked perfectly. For some reason I was thinking function when I should have been thinking command. I tried it last night and this morning and both times functioned without fail.
Thanks again for all of your help.
kenmcn816 |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Tue Aug 26, 2003 3:56 pm Post subject: |
|
|
I'm glad to help... it just so happened that I needed the same kind of thing a few weeks ago and that was the simplest way to do it. _________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
| Back to top |
|
 |
|