Library code snippets

Make sure the Inet control has all its data

When you issue the GetChunk command for the Inet control, don't
forget to wait until it's done before continuing with code that
manipulates the return values. Depending on the user's connection
speed, the GetChunk method may take several seconds. To give the
method a chance to complete before executing the rest of the code,
use the DoEvents keyword, like so:
Private Function GetData()
Dim vData As Variant
Dim strTemp As String
Do
  vData = Inet1.GetChunk(256, icString)
  DoEvents
  If Len(vData) Then
    strTemp = strTemp & vData
    lblBytesReceived.Caption = CStr(Len(strTemp))
  End If
Loop While Len(vData)
GetData = strTemp
End Function

Comments

  1. 01 Oct 2002 at 18:46

    This was exactly what I needed. Thanks.


    - Steve

  2. 01 Jan 1999 at 00:00

    This thread is for discussions of Make sure the Inet control has all its data.

Leave a comment

Sign in or Join us (it's free).

AddThis

Related discussion