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

waituntil command problem

Status
Not open for further replies.

kyle83

IS-IT--Management
Aug 4, 2006
8
0
0
Hi,

Im fairly new to aspect scripting. In the following code below, I want it to loop this script every 3 minutes. I had it working for a little while, then all of a sudden it seemed to ignore the whole waituntil command, and would run over and over again, one right after the other. It wouldn't wait 3 minutes in between each iteration.. any idea?? Thanks in advance.

- Kyle

proc main

#include "pw5menu.inc"
integer Loops = 0
string ThisTime
long TimeNum,NextTimeNum

while (Loops++) < 200

ThisTime = $Time24
strsltime $DATE ThisTime TimeNum ;converts a date & time string to a long variable
NextTimeNum = TimeNum + 180 ;Waiting for 3 minutes


transmit " PRINT IMSKU IMDLS IMDLR XIMQMN XIMQOM XIMQOH XIMQOO XIMQAL XIMQTD XIMQB\"
pause 1
transmit "^M"
waitfor "->"
pause 1
transmit "WHERE IMSEQNUM<99999"
pause 1
transmit "^M"
waitfor "'T'erminal, 'P'rinter, or 'F'ile? "
transmit "F^M"
waitfor " File Name? "
transmit "QUANTITIES.TXT"
pause 1
transmit "^M"
waitfor "Q>"
waituntil NextTimeNum

endwhile
endproc
 
Also, I would use the pause command, but the small amount of time that each iteration takes up makes it not execute exactly every 3 minutes. because the script processing time varies slightly each time.
 
I don't see anything obviously wrong with the script. What you might try doing is using converting NextTimeNum back to a string using the ltimestrs command and outputting that to the status line using the statmsg command. That way you can see what time the script is generating and see if that looks correct to you. One thing I'm wondering about is if the script has enough "slack" in it such that the script is still executing when the computed time arrives, instead of paused at the waituntil command as expected.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top