proc main string DateString, TimeString, sCap string CapName ; Name of capture file to open. ; Grab current time and date and place them into those string variables ltimestrs $LTIME DateString TimeString ; I found out that Procomm does not like slashes or colons in capture filenames ; so lets replace all of these offending delimiters with hyphens strreplace DateString "/" "-" ;Replace all slashes in date string with hyphens strreplace TimeString ":" "-" ;Replace all colons in time string with hyphens ; Now concatenate the capture filename together strcat CapName "Procomm_Capture_" strcat CapName DateString strcat CapName "_" strcat CapName TimeString strcat CapName ".cap" set capture overwrite on ; overwrite old capture file data with new data set capture query off ; do not prompt user for caputre filename set capture file CapName ; Set name of capture file (pieced together from above). capture on ; Open up the capture file. ; We need to set up a "hook" to allow the capture file to be closed when a user ; stops the script. when USEREXIT call close_capture ; Main capture loop. This is an infinite loop that grabs the current time, formats ; and dumps a time stamp string into the capture stream and then sleeps for 60 seconds ; before it does it again. This loop will run until the user stops the script or ; exits Procomm while 1 ltimestrs $LTIME DateString TimeString strfmt sCap "`r`nProcomm PC clock time: %s %s`n`n`r" DateString TimeString termwrites sCap pause 60 endwhile endproc proc close_capture string DateString, TimeString, sCap ; Drop a final timestamp into the capture file before closing ltimestrs $LTIME DateString TimeString strfmt sCap "`r`nProcomm PC clock time: %s %s`n`n`r" DateString TimeString termwrites sCap capture off ; Close the capture file. exit endproc