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

Smarterm Macro

Status
Not open for further replies.

keithja

MIS
Sep 12, 2003
88
US
Hi All,

In Esker SmarTerm 16, does anyone know a way to open a variable-named capture file using a Smarterm Macro?

basically I want to open capture files named 'host-timestamp.log'

but even when using something simple like this:
Fname="Test.txt"
retval =Session.Capture(Fname)

It fails to open the capture file and returns a 0

whereas
retval =Session.Capture("test.txt")
works.

Ive tried:

retval =Session.Capture((Fname))
retval =Session.Capture(""&Fname)
retval =Session.Capture($Fname)


The exact code Im using is:

Dim HostName as String
Dim TStamp as Date
Dim CPath as String
Dim Fname as String

'end any previous captures still running
Session.EndCapture
'HostNam = Circuit.TelnetHostName
If Circuit.Connected Then
HostNam=Session.caption
HostNam = Word$(HostNam,1)
End if
CPath = "C:\Subd\"
TStamp = Now()
Fname = "'" & CPath & HostNam & "-" & TStamp & ".Log" & "'"
'Set to Append
Session.CaptureFileHandling=smlAPPEND
'Start Capture
'retval =Session.Capture("test.txt")
retval =Session.Capture(Fname)
IF retval = FALSE Then
session.echo "Capture failed to start"
'session.echo retval
End If


any help is appreciated!

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top