I have this script which is run daily and it opens a connection in the connection directory and logs into my pbx and opens a cap file with yyyymmdd format capturing a large list from my pbx but It is creating a temp file and a file with todays date but the file with todays date is 0bytes - the temp file does contain the list i want to capture. I have tried putting the open/close cap file in different places and I have put the proc to create the file with todays date in different places in the script order but just cant seem to see the forest for the trees on this one. I have used pcplus since dos and always thought myself to be pretty good at it but you guys on this site just blow me away!!!! I have a copy of my script below. This forum is the BOMB!!!!Thanks to all!!!!
KYCOM
;Recorded script. Editing may be required.
;**********************************************************
string sCapPath, sCapFile, sCapFile2, sNewFile
integer iYear, iMonth, iDay, iHour, iMin, iSec
;***********************************************************
proc main
connect DATA "raytown pbx_1" ;connect
waitquiet 8
call raytown_pbx_login
pause 4
call copy_to_file
pause 4
call switch_pbx_ray
endproc
;*********************************
proc copy_to_file
set capture file "temp.txt"
fetch capture path sCapPath
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
strfmt sNewFile "%d%02d%02d_ry" iYear iMonth iDay
strcat sNewFile ".TXT"
strfmt sCapFile "%s\temp.txt" sCapPath
strfmt sCapFile2 "%s\%s" sCapPath sNewFile
shortpath sCapFile sCapFile
rename sCapFile sCapFile2
endproc
;*********************************
proc raytown_pbx_login
waitquiet 5
transmit "USA025^M"
waitfor "Command: "
transmit "7^M"
waitfor "Which host port? (1,2,^H) "
transmit "1^M"
waitfor "K - use <control>] A to terminate^M^J"
transmit "^M"
pause 4
endproc
;*********************************
proc switch_pbx_ray
transmit "LOHI^M5757^M"
waitfor ">"
waitquiet 2
transmit "LD 49^M"
waitfor "REQ "
transmit "prt^M"
waitfor "TYPE "
transmit "idc^M"
waitfor "CUST "
transmit "0^M"
waitfor "DCNO "
capture on
transmit "0^M"
pause 180
waitquiet 10
pause 60
capture off
pause 60
disconnect
pause 10
pwexit
endproc
KYCOM
;Recorded script. Editing may be required.
;**********************************************************
string sCapPath, sCapFile, sCapFile2, sNewFile
integer iYear, iMonth, iDay, iHour, iMin, iSec
;***********************************************************
proc main
connect DATA "raytown pbx_1" ;connect
waitquiet 8
call raytown_pbx_login
pause 4
call copy_to_file
pause 4
call switch_pbx_ray
endproc
;*********************************
proc copy_to_file
set capture file "temp.txt"
fetch capture path sCapPath
ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
strfmt sNewFile "%d%02d%02d_ry" iYear iMonth iDay
strcat sNewFile ".TXT"
strfmt sCapFile "%s\temp.txt" sCapPath
strfmt sCapFile2 "%s\%s" sCapPath sNewFile
shortpath sCapFile sCapFile
rename sCapFile sCapFile2
endproc
;*********************************
proc raytown_pbx_login
waitquiet 5
transmit "USA025^M"
waitfor "Command: "
transmit "7^M"
waitfor "Which host port? (1,2,^H) "
transmit "1^M"
waitfor "K - use <control>] A to terminate^M^J"
transmit "^M"
pause 4
endproc
;*********************************
proc switch_pbx_ray
transmit "LOHI^M5757^M"
waitfor ">"
waitquiet 2
transmit "LD 49^M"
waitfor "REQ "
transmit "prt^M"
waitfor "TYPE "
transmit "idc^M"
waitfor "CUST "
transmit "0^M"
waitfor "DCNO "
capture on
transmit "0^M"
pause 180
waitquiet 10
pause 60
capture off
pause 60
disconnect
pause 10
pwexit
endproc