bluerigsby
Technical User
Hi can anyone help here. I use the attached script to capture hourly reports from my Meridian pbx. The hourly reports are OK upto the end of day report at 18:00.
The 18:00 report is captured to the file OK but each segment is truncated , missing important data that is definately in the Procomm buffer !!!
Here is the script :
string cmd="ncopy c:\capture\"
string szFileName = $DATE
string szDate = $DATE
integer Pos = 0
proc main
dial data "Option 11"
set capture overwrite OFF ; if capture file exists, append data to it.
capture off ; close capture file if it is open
when TARGET 0 "*PER GT HR*" call CLOSECAP
Startloop:
clear ; clear contents of screen and scroll back buffer
szFileName = $DATE
szDate = $DATE
while 1
if nullstr szFileName ; Check to see if we've reached
exitwhile ; the end of source string
endif ; and if so, exit loop.
if strfind szFileName "/" Pos ; Check for char
strdelete szFileName Pos 1 ; and delete it
else
exitwhile ; exit if no more characters
endif
endwhile
strcat szFileName ".txt"
set capture file szFileName ; Set name of capture file.
capture on ; Open up the capture file.
while strcmp $DATE szDate ; Loop while date is the same
endwhile ; or if the date changes,
capture off ; Close the capture file.
goto Startloop ; and start a new one.
endproc
proc closecap
pause 15
strcat cmd szFileName ; Append to variable "CMD"
strcat cmd "\\GIMG1\capture_CST_stats\" ; Append network drive to "CMD"
transmit "^M***********^M" ; Put in asteriks between hourly reports
capture off ; Close capture file
pause 5
DOS cmd HIDDEN i0 ; Run "CMD" in DOS and copy file to the LAN
pause 10
taskexit i0 ; Exit DOS window
pause 10
cmd="ncopy c:\prowin3\capture\" ; Reset "CMD"
capture on ; Turn Capture back on.
Endproc
Any help appreciated !
The 18:00 report is captured to the file OK but each segment is truncated , missing important data that is definately in the Procomm buffer !!!
Here is the script :
string cmd="ncopy c:\capture\"
string szFileName = $DATE
string szDate = $DATE
integer Pos = 0
proc main
dial data "Option 11"
set capture overwrite OFF ; if capture file exists, append data to it.
capture off ; close capture file if it is open
when TARGET 0 "*PER GT HR*" call CLOSECAP
Startloop:
clear ; clear contents of screen and scroll back buffer
szFileName = $DATE
szDate = $DATE
while 1
if nullstr szFileName ; Check to see if we've reached
exitwhile ; the end of source string
endif ; and if so, exit loop.
if strfind szFileName "/" Pos ; Check for char
strdelete szFileName Pos 1 ; and delete it
else
exitwhile ; exit if no more characters
endif
endwhile
strcat szFileName ".txt"
set capture file szFileName ; Set name of capture file.
capture on ; Open up the capture file.
while strcmp $DATE szDate ; Loop while date is the same
endwhile ; or if the date changes,
capture off ; Close the capture file.
goto Startloop ; and start a new one.
endproc
proc closecap
pause 15
strcat cmd szFileName ; Append to variable "CMD"
strcat cmd "\\GIMG1\capture_CST_stats\" ; Append network drive to "CMD"
transmit "^M***********^M" ; Put in asteriks between hourly reports
capture off ; Close capture file
pause 5
DOS cmd HIDDEN i0 ; Run "CMD" in DOS and copy file to the LAN
pause 10
taskexit i0 ; Exit DOS window
pause 10
cmd="ncopy c:\prowin3\capture\" ; Reset "CMD"
capture on ; Turn Capture back on.
Endproc
Any help appreciated !