Hello everybody,

I have an application using mswinsock control that connect to telnet port, and I'm making a function to print the output from host, to text file.
When the response from host is more than one page, I have to send some input entry to make it scroll down one page, then write the next page to the file, and so on.

The question is, is it possible to resume to my Subroutine, when the Data Arrival Event triggered, but not at Winsock1_DataArrival() Sub?

Code Example:
Code:
Private Sub PrintOutputtoFile()
    Dialog1.ShowOpen
    Open Dialog1.FileName For Output As #TmpInt
    Print #TmpInt, textOut.Text
    If Instr(textOut.text,1,vbnewline & ")") then      'Scroll Indicator Exist
         Winsock1.SendData "md"                           'Send Move Down Command

         'The Data Arrival Event Resume Here if Possible

    Else
         Close #TmpInt
    End If
End Sub
Is there any code to make it possible? Or any other method similar to that?

Any help is appreciated.
Thanks.