Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shutting down a Procomm at a certain time?

Status
Not open for further replies.

papollo

Programmer
Oct 19, 2001
71
US
I would like to start a aspect script via a job scheduler and the shut it down at a certain time.

I was looking on
Lots of great info!

I am assumming that I did to run ASPTIME.DLL in a loop to get the current time
then have the loop checking the current time then when the specified time arrives, then I do a pwexit.

Does anyone have an example of how to shut down a script at a certain time???

Thanks
 
Here you go!

PROC MAIN
integer retval, id
long timeval1, timeval2
string exeDATE, exeTIME
TIMEVAL1 = TIMEVAL2 = 0
if dllload "ASPTIME.DLL" ID
dllcall id "ASPLTIME" $pwmainwin 2 RETVAL TIMEVAL1 "Select TIME and DATE" " Please select execution DATE: " " Please select execution TIME: "
ltimestrs TIMEVAL1 exeDATE exeTIME
endif
if retval == 1
usermsg "The date and time selected are:`n%s %s" exeDATE exeTIME
endif
waituntil exeTIME exeDATE
usermsg "Bye!"
pwexit
endproc
 
Thanks for your help.

That code displays the date and time window and the user selects the dte or time and the program ends.

I want to do this without user intervention.

I need to figure out a way to check for a certain time in the loop and then exit the script when that time arrives.

Let me play with it.

Any ideas????

 
There are a couple different system variables that you can use to get the current time and then compare it to a set time you have specified in your script. The system variables are $TIME and $TIME24. These are string values, so you may need to do some conversion from string to integer values to make the time checking easier for you. You could use the strtok command to break the string into hours, minutes, etc. and then convert those string values to integers using the atoi command. You would then compare those values to the time you want your script to exit.

Another option is to use some of the commands under the Date and Time Commands section of the ASPECT help file to get a time value and your script can then wait until that particular time value has occurred. However, I think you will find it easier to get the information you need from the $TIME or $TIME24 system variables. aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top