Re: Trapping for error and displaying receive buff - WeOnlyDo Discussion board

Re: Trapping for error and displaying receive buff (General questions)

by Eric, Friday, December 07, 2007, 16:12 (5982 days ago) @ wodDamir

I am using blocking method.

When I use the Prompt method the PromptReceived Event gets called. Here is my Routine:

[code]
Private Sub Telnet1_PromptReceived() Handles Telnet1.PromptReceived
Select Case ExecCount
Case 0
Telnet1.Prompt = Select:
Telnet1.Send( T & vbLf)
Case 1
Telnet1.Prompt = (c)Eagle Con&Dev
Telnet1.Send( e51 & vbLf)
Case 2
Telnet1.Prompt = Login User Name?
Telnet1.Send(vbCrLf)
Case 3
Telnet1.Prompt = Login Password?
Telnet1.Send( s51 & vbLf)
Case 4
Telnet1.Prompt = Login Site?
Telnet1.Send( s51eagle & vbLf)
Case 5
Telnet1.Prompt = Select or E?
Telnet1.Send( 51 & vbLf)
Case 6
Telnet1.Prompt = Select or E?
Telnet1.Send( 3 & vbLf)
Case 7
Telnet1.Prompt = Select or E?
Telnet1.Send( 3 & vbLf)
Case 8
Telnet1.Prompt = Employee Id?
Telnet1.Send( bkn & vbLf)
Case 9
Telnet1.Send( wrkrb & vbLf)
End Select

ExecCount = ExecCount + 1
End Sub
[/code]

My Code fails in Case 3. After the Telnet1.Send( s51 & vbLf) it waits the timeout time and then calls the Dicsonnect Routine by firing the Telnet1.Disconnected event. What is the event for timeout error?

Also I get confused with the Prompt and Send in the above routine. I have to set up the Prompt before the send so that the case works. Is there a better way of doing this? Would the Execute Method be better here?


Complete thread: