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
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