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!

problem with automated file capture

Status
Not open for further replies.

kycom

Technical User
Sep 4, 2003
2
0
0
US
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 &quot;K - use <control>] A to terminate^M^J&quot;
transmit &quot;^M&quot;
pause 4


endproc

;*********************************

proc switch_pbx_ray
transmit &quot;LOHI^M5757^M&quot;
waitfor &quot;>&quot;
waitquiet 2
transmit &quot;LD 49^M&quot;
waitfor &quot;REQ &quot;
transmit &quot;prt^M&quot;
waitfor &quot;TYPE &quot;
transmit &quot;idc^M&quot;
waitfor &quot;CUST &quot;
transmit &quot;0^M&quot;
waitfor &quot;DCNO &quot;
capture on
transmit &quot;0^M&quot;
pause 180
waitquiet 10
pause 60
capture off
pause 60
disconnect
pause 10
pwexit


endproc
 
What you want to do is change set capture file &quot;temp.txt&quot; to point to the file you want the captured data to appear in (either sCapFile or sCapFile2). Actually, it looks like you would want to use sNewFile since the set capture command just sets the name of the capture file and not the location of it (you would use set capture path for this setting). So I would try changing this to read set capture file sNewFile, and you will want to move the line after you have created the name for sNewFile.

aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top