Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: timewait sleep
The part I can't get is another gosub which will check to see if the time is 2:00 PM and go to sleep util 8:00am again. I've tried making a varible tt=00:00:00:09 but the varible can't be converted correctly for a comparision. I also tried strReplace to get out the : and just compare straight numbers, no good as well.
The scope is to run between 8am and 2pm and sleep the rest.
Any ideas?
Once you decide to wait for 8AM it is easy, its just a TimeWait.
But when you are running, you have to check to see 2PM roll around.
So I would.....
Right after the TimeWait("0000:00:00:08:00:00"), add
eightam=TimeYmdHms()which will capture the 8 AM time TODAY into a variable.
then in your loop someplace...
now=TimeYmdHms() diff=TimeDiffSecs(now,eightam) if diff > 8*3600 then time to wait some more
Article ID: W13894
Filename: TimeWait then Time Sleep for Awhile.txt
File Created: 1999:04:15:16:57:06
Last Updated: 1999:04:15:16:57:06