Below is the script. I suspect the reason it rights the success in the Failures file because the emulator hangs up just before the second "if". Needs a timer of how long the first "if" waits for the string “CONTINUE”. If it is not received then write to the Failure file.
Note: When the modem doesn't answer then I do not get an entry in the Failure file. Works backwards...
Thanks
ABHC
string fname ;first part of file name
string datefilename ;this is the date part of file name
proc main
dial DATA GROUP " Envoy" CONNECTALL ; Dial Symantec entry.
while $DIALING
endwhile
if $DTR == 1
waitfor "continue" ; The typical prompt you get when connected to the Envoy.
pause 5
hangup ; Hang up the phone line.
pause 5
endif
if $DTR == 0
fname = "Failures " ;put the first part of name here leave a space at the end
call file_date ;calls file_date proc
strcat fname datefilename ;this combines the two string (in this case M1_Log YYYYMMDD)
call call_fail
endif
endproc
proc file_date
integer iDay, iMonth, iYear, iHour, iMin, iSec
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
strfmt datefilename "%d%02d%02d" iYear iMonth iDay
strcat datefilename ".TXT"
return
endproc
proc call_fail
if fopen 0 Fname APPEND
fputs 0 $DIALSELECT
pause 5 ;waits 5 seconds
endif
return
fclose 0
endproc