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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

End one, start another, when that is done, start the first one?

Status
Not open for further replies.

papollo

Programmer
Oct 19, 2001
71
US
Hello:

I was asked if this could be done in Procomm.

They want to have Script 'A' running all the time.
At 7am they want Script 'A' to end
and start Script 'B'.
When Script 'B' is done
Restert script "A"

This is to run 7 days a week, except for Xmas.

Thanks in advance.

Paul
 
Here is something that should work. I have included 2 example scripts, "script1.was" & "script2.was". script1.wax runs all the time. At 7:00am everyday (except Christmas Day) script1.wax stops and script2.wax runs. Once script2.wax completes, script1.wax is restarted. script1.wax continues to run all day on Christmas day not running script2.wax till Boxing day.

Example Of script1.was
Code:
proc main
long runtime,timediff
string timestr
integer timeint
runtime = nextruntime()
timediff = runtime-$ltime
ltoa timediff timestr
atoi timestr timeint
when ELAPSED 0 timeint call nextproc
while 1
   yield
   ;
   ; enter your commands here
   ;
endwhile
endproc

proc nextproc
chain "script2.wax"
endproc

func nextruntime : long
string tdate,ttime
long nextrun,tomorrow
integer Year Month Day Hour Min Sec
tomorrow=$ltime+86400
ltimeints tomorrow Year Month Day Hour Min Sec
if Day == 25 && Month == 12          ; skip christmas day
   tomorrow+=86400                   ;
endif                                ;
ltimestrs tomorrow tdate ttime
strsltime tdate "07:00:00" nextrun
return nextrun
endfunc
Example Of script2.was
Code:
proc main
;
;  enter your commands here
;
chain "script1.wax"
endproc
 
Thanks for the examples.

Let me give it a try and get back to you with the results.

Boxing Day! Must be from the UK?
 
Australia actually.

Just one thing about the example scripts. I have assumed that script1.wax was initially started after 7:00am in the morning. If it is started before 7:00am, then script2.wax wont be executed until 7:00am the following day.
 
I am tring to get it to work, Problems are on our end with the two existing scripts not with the example that you gave me.

I do want the first script to start whenever I start your example.

FYI: I am in Raleigh, NC USA.
 
Hi, I am new to Aspect and need to try to learn it as quick and easy as possible. Does anyone have any work thru electronic manuals so i can get going.

Cheers
 
I have quite a few samples and distilled knowledge at - I link to just about all of the good Procomm and ASPECT information that I have found on the web.

There are a couple short ASPECT tutorials on the version 4.8 CD that may help you hit the ground running. Look in the \Samples\ASPECT directory on the CD and you will see two PDF files containing the tutorials. There are also several sample scripts in the same directory.


aspect@aspectscripting.com
 
I have Procomm 32 provided my my boss. I can not find the information that you are on about. are the PDF workthru manuals ?

If not do you know where there are some

Cheers
 
If you do not have version 4.8, then those PDF files will not be on your CD. If you have Procomm Plus 32, that is probably the 4.5 version. What operating system are you running? That version was only for Win95 and NT, so it may have some issues running on Win2K and Win98, for example.

I know you can get the sample scripts from Symantec (there is a link at my site), but I don't believe the tutorials are available elsewhere.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top