Re: Read buffer out of waitfor? - WeOnlyDo Discussion board

Re: Read buffer out of waitfor? (General questions)

by wodDamir, Wednesday, July 02, 2008, 13:08 (5991 days ago) @ Logan

Logan,

I don't see anything like that in help file. WaitFor does remove buffer contents if pattern is received, but not if it times out, in which case buffer remains intact.

In that case, you need to ignore the exception and invoke Receive.

Something like this:

[code]ssh1.HostName = xxxx
ssh1.Login = xxxx
ssh1.Password = xxxx
ssh1.Protocol = SSHAuto
ssh1.Blocking = True
ssh1.Connect
On Error Resume Next
Debug.Print ssh1.WaitFor( joe@debian , 5) 'this is an incorrect prompt pattern to simulate the error
MsgBox ssh1.Receive[/code]

Hope this helps.

Regards,
Damba


Complete thread: