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

Capture set statements

Status
Not open for further replies.

Pandab2002

IS-IT--Management
Apr 16, 2003
47
US
Hi all, I am using the following script:

integer a = 1
proc main
string capname = $DIALCONNECT
string cname = "TEST

set dialentry access DATA capname
set capture file cname
set capture overwrite on
Transmit "LD 95^M"
Waitfor "REQ"
Transmit "prt^M"
Waitfor "TYPE"
Transmit "NAME^M"
Waitfor "CUST"
Transmit "0^M"

Label1:
if not Waitfor "DCNO" a
Transmit "^M"
goto label1

else
Transmit "1^M"
Waitfor "IDC"
Transmit "all^M"
Waitfor "SHRT"
Transmit "yes"
pause 1
clear
capture on
transmit "^M"
Waitfor "REQ"
capture off
Transmit "end^M"
set capture file NONE
;execute "freadtest.wax"
endif
endproc

Anyway, I am wanting the script to go into a PBX, print out some information and capture it to a file named "Test.cap" or I want to use the $DIALCONNECT variable. I want the capture file to overwrite each time the script is run. When I try the above script, it seems to ignore my set capture statements. What am I missing?

PAul...
 
WOW!!! It started working without any changes, and now it's not working again. I didn't touch the programming. I don't get it. any suggestions???
 
My initial hunch is that the set dialentry command is causing the following set capture commands to be applied to the referenced Connection Directory entry instead of Procomm's global settings, but I haven't had a chance to verify that yet (must go mow my jungle before the light goes away!).


aspect@aspectscripting.com
 
I I hate to bring up dead threads but I have a loop using the same type of statement above to insure the username/password are upto date

set dialentry access DATA strDealerNum
set password strPassword
set userid strUserName

however I use the same type of statement for adding them and setting the values.

What is occuring is that if i execute teh child script manually, the capture file is named the way i set it in the script; However if i execute it in a loop from another script the capture file is the actual variable name with .cap appended on it. This is very very odd, mroe so that when it gets to the next script it over writes the last file, but at the same time creates the file that I set in the capture file statement.

string strname

strname = "3333dfs.txt"

set capture file strname

comes out to be strname.cap

Any more information can be provided?


 
Not sure if I can post the full script.

but here goes


proc main

for intCounter = 1 upto intDealerCount
strfmt strDealerKey "Dealer%d" intCounter
profilerd strDealerPath "Dealers" strDealerKey strDealerNum

strcmp strDealerNum "" intCmp
if intCmp != 0
;Get all variables from INI file
profilerd strDealerPath strDealerNum "UserName" strUserName
profilerd strDealerPath strDealerNum "Password" strPassword
profilerd strDealerPath strDealerNum "Script" strFileName
profilerd strDealerPath strDealerNum "Convert" strConvert
profilerd strDealerPath strDealerNum "Acct" strAcctType
profilerd strDealerPath strDealerNum "Name" strDealerName
profilerd strDealerPath strDealerNum "Dial" strDialNumber
profilerd strDealerPath strDealerNum "AltDial1" strAlt1DialNumber
profilerd strDealerPath strDealerNum "AltDial2" strAlt2DialNumber
profilerd strDealerPath strDealerNum "Status" intStatus
profilerd strDealerPath strDealerNum "Misc" strMisc

s0 = strDealerNum

if DialExists(strDealerNum) == 0
strfmt strLogMsg "Creating DialEntry for: [%s] using #[%s] @ [%s %s]" strDealerNum strDialNumber $Date $Time
Log(LOG_FILE,strLogMsg)
AddDialEntry(strDealerNum,strDialNumber, strDealerName,strUserName,strPassword,strAcctType,strMisc)
else
set dialentry access DATA strDealerNum
set password strPassword
set userid strUserName
set misc strMisc
strcmp strAlt1DialNumber "" intCmp
if intCmp != 0
UpdateDialEntry(strDealerNum,strAlt1DialNumber)
endif
endif
strcmp strFileName "" intCmp
if intStatus == 0
if intCmp != 0
if strcmp strAcctType "R&R"
strfmt strScriptFile SCRIPT_DIR_RR "Pull" strFileName
else
strfmt strScriptFile SCRIPT_DIR_ADP "Pull" strFileName
endif
if isfile strScriptFile
strfmt strLogMsg "Executing Script File: [%s] for [%s] @ [%s %s]" strScriptFile strDealerNum $Date $Time
Log(LOG_FILE,strLogMsg)
set capture file NONE
execute strScriptFile SHARED
LogExitCode(strDealerNum,$ExitCode)
else
strfmt strLogMsg "Script [%s] doesn't exist for [%s] @ [%s %s]" strScriptFile strDealerNum $Date $Time
Log(LOG_FILE,strLogMsg)
endif
ResetEvents()
endif
profilewr strDealerPath strDealerNum "Status" 1
endif

endif
endfor
endproc


--- Main proc of R&R file

string strName
strName = "001.txt"
dial DATA "dname"

while $dialing
endwhile

if $Carrier == 0
exit -1
endif

s1 = $UserId
s2 = $Password


;Do login stuff then the get to menu to get report stuff.

set terminal columns 132

set capture path rrpath
set capture overwrite on
set capture file strName ; this is the issue

the file when looking in the directory is "strName.cap" rather than "001.txt"



 
OK, some shots in the dark here. Is the value in rrpath valid? Is there a capture file specified for the Connection Directory entry that you are dialing (check the Basic Options button)?

 
Yes the name that i want to, it seems to set the name but doesn't use it. I cleared them out and still nothing.

Yes it is a valid path, it works correctly if I execute the script without a parent.
 
Without seeing the full scripts it's hard to say, but try commenting out any set capture commands in your main script and see if that does the trick. I see one place where you have set capture file in the main script.


 
that is the core part of the script if you would like I can email them to you. They are R&R and ADP scripts.
 
You have not responded to my email with the content, I was wondering if you had a chance to look at it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top