This site has been a great help in my writing aspect files. How could I modify the waitlist.was to change text colors when it hits a keyword? If it finds "error" then red or "T1" it turns green etc...I know I use termwrites and waitfor but imm foggy on the rest. Thanks
; Global var for WaitList() procedure
INTEGER WaitListStat = 0
;***************************************************************************
; Wait for a list of up to three strings
;
; Passed: INT: maximum # of seconds to wait
; STRING: Data string #1
; STRING: Data string #2
; STRING: Data string #3
;
; Use $NULLSTR to ignore a parameter.
;
; On Exit: Global WaitListStat = Data string # or 0
;***************************************************************************
PROC WaitList
PARAM INTEGER maxTime
PARAM STRING string1, string2, string3
INTEGER loopControl
#IFDEF ASPDEBUG
STRFMT S0 "WaitList on `"%s`" `"%s`" `"%s`"" string1 string2 string3
#ENDIF
WaitListStat = 0
WHEN TARGET 0 string1 CALL WaitListS1
WHEN TARGET 1 string2 CALL WaitListS2
WHEN TARGET 2 string3 CALL WaitListS3
FOR loopControl = 1 UPTO maxTime
PAUSE 1
IF WaitListStat
RETURN
ENDIF
ENDFOR
;; Failure, never received any. Clear them all and exit.
WHEN TARGET 0 CLEAR
WHEN TARGET 1 CLEAR
WHEN TARGET 2 CLEAR
ENDPROC
PROC WaitListS1
WHEN TARGET 0 CLEAR
WHEN TARGET 1 CLEAR
WHEN TARGET 2 CLEAR
WaitListStat = 1
ENDPROC
PROC WaitListS2
WHEN TARGET 0 CLEAR
WHEN TARGET 1 CLEAR
WHEN TARGET 2 CLEAR
WaitListStat = 2
ENDPROC
PROC WaitListS3
WHEN TARGET 0 CLEAR
WHEN TARGET 1 CLEAR
WHEN TARGET 2 CLEAR
WaitListStat = 3
ENDPROC
;***************************************************************************
;PROC SampleUsage
; ;; Wait for one of two prompts. No third prompt, so passing in $NULLSTR
; WaitList(30, "enter to continue...", "press X to exit:", $NULLSTR)
; if WaitListStat == 1
; ;; got the "enter to continue..." prompt
; elseif WaitListStat == 2
; ;; got the "press X to exit:" prompt
; elseif WaitListStat == 3
; ;; this one can't happen. We passed in $NULLSTR
; elseif WaitListStat == 0
; ;; didn't find any of the prompts, timed out after 30 seconds
; endif
;ENDPROC
; Global var for WaitList() procedure
INTEGER WaitListStat = 0
;***************************************************************************
; Wait for a list of up to three strings
;
; Passed: INT: maximum # of seconds to wait
; STRING: Data string #1
; STRING: Data string #2
; STRING: Data string #3
;
; Use $NULLSTR to ignore a parameter.
;
; On Exit: Global WaitListStat = Data string # or 0
;***************************************************************************
PROC WaitList
PARAM INTEGER maxTime
PARAM STRING string1, string2, string3
INTEGER loopControl
#IFDEF ASPDEBUG
STRFMT S0 "WaitList on `"%s`" `"%s`" `"%s`"" string1 string2 string3
#ENDIF
WaitListStat = 0
WHEN TARGET 0 string1 CALL WaitListS1
WHEN TARGET 1 string2 CALL WaitListS2
WHEN TARGET 2 string3 CALL WaitListS3
FOR loopControl = 1 UPTO maxTime
PAUSE 1
IF WaitListStat
RETURN
ENDIF
ENDFOR
;; Failure, never received any. Clear them all and exit.
WHEN TARGET 0 CLEAR
WHEN TARGET 1 CLEAR
WHEN TARGET 2 CLEAR
ENDPROC
PROC WaitListS1
WHEN TARGET 0 CLEAR
WHEN TARGET 1 CLEAR
WHEN TARGET 2 CLEAR
WaitListStat = 1
ENDPROC
PROC WaitListS2
WHEN TARGET 0 CLEAR
WHEN TARGET 1 CLEAR
WHEN TARGET 2 CLEAR
WaitListStat = 2
ENDPROC
PROC WaitListS3
WHEN TARGET 0 CLEAR
WHEN TARGET 1 CLEAR
WHEN TARGET 2 CLEAR
WaitListStat = 3
ENDPROC
;***************************************************************************
;PROC SampleUsage
; ;; Wait for one of two prompts. No third prompt, so passing in $NULLSTR
; WaitList(30, "enter to continue...", "press X to exit:", $NULLSTR)
; if WaitListStat == 1
; ;; got the "enter to continue..." prompt
; elseif WaitListStat == 2
; ;; got the "press X to exit:" prompt
; elseif WaitListStat == 3
; ;; this one can't happen. We passed in $NULLSTR
; elseif WaitListStat == 0
; ;; didn't find any of the prompts, timed out after 30 seconds
; endif
;ENDPROC