A
Aidy
I've got this code in a class
<snip>
Option Explicit
Private WithEvents m_ttHost As teemtalk.Host
Private mPassword As String
Private mWaitFor As String
Private mUser
Public Sub LogIntoHost()
Set m_ttHost = teemtalk.CurrentSession.Host
With m_ttHost
.ClearWaitFors
.Send mUser
.Send Chr(13)
.WaitFor mWaitFor
End With
End Sub
Private Sub m_ttHost_OnWaitforString(ByVal WaitFor As String)
If (WaitFor = mWaitFor) Then
m_ttHost.Send mPassword
m_ttHost.Send Chr(13)
End If
End Sub
Public Property Let WaitFor(sWaitFor As String)
mWaitFor = sWaitFor
End Property
Public Property Let User(sUser As String)
mUser = sUser
End Property
Public Property Let Password(sPassword As String)
mPassword = sPassword
End Property
<snip>
Which works fine when I instantiate it. The waitfor method waits
for a string to appear then does something
I've got antoher class with some code
<snip>
Option Explicit
Private WithEvents ttHost As teemtalk.Host
Private mSendString As String
Private mWaitFor As String
Public Sub WaitForAndEnter()
Set ttHost = teemtalk.CurrentSession.Host
With ttHost
.ClearWaitFors
.WaitFor mWaitFor
End With
End Sub
Private Sub ttHost_OnWaitforString(ByVal WaitFor As String)
If (WaitFor = mWaitFor) Then
ttHost.Send mSendString
ttHost.Send Chr(13)
End If
End Sub
Public Property Let WaitForString(sWaitFor As String)
mWaitFor = sWaitFor
End Property
<snip>
When I instantiate these two classes one after another however
the waitfor method does not work in the first instance.
Any ideas?
Aidy
<snip>
Option Explicit
Private WithEvents m_ttHost As teemtalk.Host
Private mPassword As String
Private mWaitFor As String
Private mUser
Public Sub LogIntoHost()
Set m_ttHost = teemtalk.CurrentSession.Host
With m_ttHost
.ClearWaitFors
.Send mUser
.Send Chr(13)
.WaitFor mWaitFor
End With
End Sub
Private Sub m_ttHost_OnWaitforString(ByVal WaitFor As String)
If (WaitFor = mWaitFor) Then
m_ttHost.Send mPassword
m_ttHost.Send Chr(13)
End If
End Sub
Public Property Let WaitFor(sWaitFor As String)
mWaitFor = sWaitFor
End Property
Public Property Let User(sUser As String)
mUser = sUser
End Property
Public Property Let Password(sPassword As String)
mPassword = sPassword
End Property
<snip>
Which works fine when I instantiate it. The waitfor method waits
for a string to appear then does something
I've got antoher class with some code
<snip>
Option Explicit
Private WithEvents ttHost As teemtalk.Host
Private mSendString As String
Private mWaitFor As String
Public Sub WaitForAndEnter()
Set ttHost = teemtalk.CurrentSession.Host
With ttHost
.ClearWaitFors
.WaitFor mWaitFor
End With
End Sub
Private Sub ttHost_OnWaitforString(ByVal WaitFor As String)
If (WaitFor = mWaitFor) Then
ttHost.Send mSendString
ttHost.Send Chr(13)
End If
End Sub
Public Property Let WaitForString(sWaitFor As String)
mWaitFor = sWaitFor
End Property
<snip>
When I instantiate these two classes one after another however
the waitfor method does not work in the first instance.
Any ideas?
Aidy