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!

Set Capture Query On question

Status
Not open for further replies.

timorr

MIS
Dec 4, 2001
9
CA
Hello,

I have a script that, as it is logging into the far end, prompts the user if they want to start a capture file or not:

set capture overwrite off
set capture query on
set capture file capfile
capture on


It goes on and creates the file name based on the date & time and all. That all works good. The problem I am having is, when it prompts them with the 'Capture File' window, if they click cancel (meaning they don't want to start a capture file), it still creates a file with 0 bytes in the capture directory. In an effort to keep that directory cleaned out, I added a section of script to try to delete that file:

if findfirst capfile1
ifilesize = $FSIZE
itoa ifilesize sfilesize
if strcmp sfilesize zero
delfile capfile1
endif
endif

Basically, if the file size is 0, I want it to delete the file. This sometimes works with no problem, but most of the time doesn't. It is weird, if I sit there and try to play with the script to make it work, and have a window open in the capture directory (so I can sit there and watch the file be created, then watch it be deleted), it seems to work every time. If I don't have that window open, though, it does not work most of the time.

Does anyone have any idea how to make this work every time??

In case you need it, I am using Windows2000 & Procomm 4.8

Any help would be appreciated.

Thanks,

Tim
 
How about this:

Code:
proc main
	integer Choice = 0
	string capfile = "C:\captest.txt"
	
	sdlgmsgbox "" "Capture File?" Question YESNO Choice
	
	if Choice == 6 	;Yes
		set capture overwrite off
		set capture query on
		set capture file capfile
		capture on
	endif

endproc

This way you avoid creating the file to begin with, if you don't want to.
 
KODR, Thanks. I had not thought about bypassing the built in query, and just build my own. That works much better.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top