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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Direct Connection and Capture file 2

Status
Not open for further replies.

ManMe

Technical User
Apr 22, 2002
4
US
I am running a direct connection and I want the capture file to start when I restart the application. Procomm will start the capture file on connection when using a modem but, if I close the application and restart it using a direct connection the capture file will not start. I have a .bat file that will stop and start the application Procomm but, I need the capture file to start also. I would appreciate any help.
 
How are you automatically turning on the capture file with the modem connection? Are you using a script or are you turning on the Start capture on connection checkbox of the Capture File Options dialog in the Connection Directory? Does this not work if you specify a direct connection instead of a modem connection for the Connection Directory entry? I'm not set up to test a direct connection, so I don't know the answer to those questions.

If it turns out that the above is what you are doing and it does not work, then you could attach a short script to the Connection Directory entry that opens your capture file after you have selected the Connection Directory and made your connection. You can attach the script by opening the Connection Directory, selecting the particular entry, click on the Basic Options button, and choose your script from the Script listbox. Here is what the script should look like:

proc main
capture on
endproc

You may need to specify some of the set capture commands if the defaults are not to your liking. Also, this script will require you to manually close the capture file when you have completed receiving all of the necessary information.
 
Hello,

I have a Startup Script that I Move into My Script Path when I'm working on a Direct Connection to a Nortel Networks DMS-100. That way when I start Procomm Plus 4.8, I connect to the DMS100 Entry in the Connection Group DirectConn that I setup. I altered my Script so Capture Turns on Automatically with a Capture File Name Based on Timestamp. This is Part of the Startup that Gets my Connection Entry.

CONNECT DATA Group "DirectConn" "dms100"

Hank
 
Hey Guy thanks. I used the script Hank help me with and I have my capture file working. I would like to name my file from the date,timestamp. I downloaded a script from the Procomm Plus site (date.was) I modified the script, the date for the file is working except, I want the file to show 20020427 and it shows up now as 4272. Do you have any suggesting? I will send you the modified script if you need to look at it.
 
Here's an example of how to create a filename in the format you want. I prefer to use the ltimeints command instead of parsing the results of $DATE. The %02d format string is to make sure that the month and day are always two digits. Let me know if you have any questions.

proc main
integer iDay, iMonth, iYear, iHour, iMin, iSec
string sCapture

ltimeints $LTIME iYear iMonth iDay iHour iMin iSec

strfmt sCapture "%d%02d%02d" iYear iMonth iDay
endproc
 
This was My Solution from the Help File Examples: Works well on PC 4.8 but MANME is running PC 3.0.. But from the PC 2.1 Book, it should work..
But I like Knob's Example Better. Cleaner... Cool Knob...

;* DateTime.was
;*
;* $DATE and $Time Test Test Script
;*
proc Main
string szCapFile
string szMonth, szDay, szYear, szHH, szMM
strextract szMonth $DATE "/" 0
strextract szDay $DATE "/" 1
strextract szYear $DATE "/" 2
strextract szHH $time24 ":" 0
strextract szMM $time24 ":" 1
strfmt szMonth "%02.2s" szMonth
strfmt szDay "%02.2s" szDay
strfmt szCapFile "%s%s%s%s%s.txt" szHH szMM szMonth szDay szYear
;* Capture File Name is : szCapFile = 0203042602.txt = Format
termwrites szCapFile
endproc

That's why Tek-Tips is Great..... There's always a Better Way...
 
Hank and Knob
The example below works but, the format is incorrect.. I tried the example you gave me knob and I couldn't get it to work. I don't understand why the example below works and the two example you all sent me will not work. What am I missing.


proc GetFileNam

integer Position = 1

FileName = $DATE ;sets the name from Control Panel
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 ".TXT"
endproc
 
Try using this script, you should be able to replace your entire existing GetFileNam procedure with this:

proc GetFileNam
integer iDay, iMonth, iYear, iHour, iMin, iSec

ltimeints $LTIME iYear iMonth iDay iHour iMin iSec

strfmt FileName "%d%02d%02d" iYear iMonth iDay
strcat FileName ".TXT"
endproc
 
Hello,

I took Knob's Example and Reworked it. Works Fine on Procomm 4.8 / Win 98SE.
The Example Outputs DDMMYYYY.txt.. No TimeStamp is Given, so if you connect Several Times a Day, you have a Problem... But this Model Works well. I would Compile it and see if it works as a Model. If the Terminal shows a Date.txt File Name,
use it in your Procedure Call for The File Name. If your Script Still Fails, then your problem may be a Global Variable / Local Procedure Variable Problem.

Knobs Example as a Model:

proc Main
string FileName
integer iDay, iMonth, iYear, iHour, iMin, iSec

ltimeints $LTIME iYear iMonth iDay iHour iMin iSec

strfmt FileName "%02d%02d%2d" iMonth iDay iYear
strcat FileName ".TXT"
termwrites FileName
termwrites "`n`r" ;* Should See MMDDYYYY.txt
endproc
 
Hey Gentlemen, I plugged in knob's script for GetFileNam, Hank's script for CaptureFileOn and I am up and running with the Capture file as 20020501. I am using a bat file to open and close the application in the ProComm scheduler. Hey!!! You guys are awesome Thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top