djspider74
Technical User
Hello,
I put together this script that I thought would work to create a capture file and advance the name of the file along with the date. The problem is that the name of the file doesnt advance with the date. It is almost like the $DATE isnt updating when the loop gets to it again. Is there a way to reset the system variables when the loop runs again? Here is what I have so far. Thanks!!!
proc main
string FileName
string Conn
string TimeStr
integer Position = 1
#define TRUE 1
while TRUE
FileName = $DATE ;sets the name from Control Panel
Conn = $DIALCONNECT
while (Position != 0)
strfind FileName "/" Position ;searches for / (illegal character)
if failure ;tests for a failure
Position = 0 ;sets condition to False
else ;successful search
strdelete FileName Position 1 ;removes illegal character
endif
endwhile
while (Position != 0)
strfind FileName "-" Position ;searches for -(illegal character)
if failure ;tests for a failure
Position = 0 ;sets condition to False
else
strdelete FileName Position 1 ;removes illegal character
endif
endwhile
strcat FileName Conn
strcat FileName ".log"
set capture file FileName ;sets the capture filename
capture on
TimeStr = "23:59:59"
waituntil TimeStr
capture off
pause 2
endwhile
endproc
I put together this script that I thought would work to create a capture file and advance the name of the file along with the date. The problem is that the name of the file doesnt advance with the date. It is almost like the $DATE isnt updating when the loop gets to it again. Is there a way to reset the system variables when the loop runs again? Here is what I have so far. Thanks!!!
proc main
string FileName
string Conn
string TimeStr
integer Position = 1
#define TRUE 1
while TRUE
FileName = $DATE ;sets the name from Control Panel
Conn = $DIALCONNECT
while (Position != 0)
strfind FileName "/" Position ;searches for / (illegal character)
if failure ;tests for a failure
Position = 0 ;sets condition to False
else ;successful search
strdelete FileName Position 1 ;removes illegal character
endif
endwhile
while (Position != 0)
strfind FileName "-" Position ;searches for -(illegal character)
if failure ;tests for a failure
Position = 0 ;sets condition to False
else
strdelete FileName Position 1 ;removes illegal character
endif
endwhile
strcat FileName Conn
strcat FileName ".log"
set capture file FileName ;sets the capture filename
capture on
TimeStr = "23:59:59"
waituntil TimeStr
capture off
pause 2
endwhile
endproc