SLEEPQQ or timer?

SLEEPQQ or timer?

dzallar's picture

I am writing a small program to start an external program at a specified time. The user inputs the time they wish the external program to start. My code as of now basically gets the system time and compares that to the user input start time:
do while (remain_sec .GT. 0)
CALL SLEEPQQ(1000)
CALL GETTIM(tmphour, tmpminute, tmpsecond, tmphund)
now_sec = tmphour * 3600 + tmpminute * 60
remain_sec = start_sec - now_sec
hour_left = int(remain_sec / 3600)
min_left = ((remain_sec / 3600) - hour_left) * 60
end do

When I run the program, the dialog box is not responsive to anything. I would like to be able to minimize the dialog or press my stop button.
Does anyone have any suggestions? Any help would be greatly appreciated.
David

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
james@elementyl.com's picture

If you are on the NT family you can just use SYSTEM to issue an appropriate AT or SCHTASKS (XP) command which will allow your program to continue.

James

alfredodell's picture

You could try subroutine alarm in dfport.
Or you could create a thread to wait till the right time.

Login to leave a comment.