Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: timewait
Note that you can also just do a:
TimeWait("0000:00:00:05:30:00")and not have to do the date calculations when using the TimeWait function.
Note: the TimeAdd line below could be written as:
timeout=TimeAdd(TimeYmdHms(),"0000:00:00:13:22:00") ; 13 hrs, 22 minutes from now
a=TimeYmdHms() ;;Get the current date and time ;;parse the date out Year=Itemextract(1, a, ":") Month=ItemExtract(2, a, ":") Day=ItemExtract(3, a, ":") ;;concantenate the parts back together adding empty time fields at the end. a=strcat(year, ":", month, ":", day, ":", "00:00:00") b=TimeAdd(a,"0000:00:00:13:22:00") ; Add your specified time in TimeWait(b) ; Waits for that time to occur Display(3, "The time should now be", b)
filename = "clock.exe" now=TimeYmdHms() days = 00 mins = 00 hours = 00 secs = AskLine("Title","enter a number of seconds to wait before running clock.exe",10) runtime=TimeAdd(now,"0000:00:%days%:%hours%:%mins%:%secs%") TimeWait(runtime) ; wait for time to elapse success = Run(filename,"") ; run it If success == 1 WinPlace(87,56,425,543,`Clock`) success = "Clock Ran!!" Else success = "Sorry, Clock wasn't able to run" End If Message("Title",success)
Article ID: W13892
Filename: TimeWait Examples.txt
File Created: 2001:03:23:13:22:24
Last Updated: 2001:03:23:13:22:24