Foros del Web » Programación para mayores de 30 ;) » Programación General »

VB : ruego ayuda con 5 líneas de código

Estas en el tema de VB : ruego ayuda con 5 líneas de código en el foro de Programación General en Foros del Web. Esta vez no es una duda sino un gran problema para mi, necesito entender que hace todo lo que hay en el bucle While que ...
  #1 (permalink)  
Antiguo 06/02/2003, 18:52
 
Fecha de Ingreso: febrero-2002
Mensajes: 25
Antigüedad: 22 años, 2 meses
Puntos: 0
VB : ruego ayuda con 5 líneas de código

Esta vez no es una duda sino un gran problema para mi, necesito entender que hace todo lo que hay en el bucle While que he puesto en negrita, para la semana que viene, (me lo van a preguntar y no entiendo porque hay esas variables data1 y data2, como funcionan, la asignación y el resto del contenido del bucle. Desde luego es importante porque a poco que lo modifico no funciona el programa.

En fin si algun alma caritativa me puede aportar algo de luz se lo agradeceria muchísimo.

(Por si a alguien le puede valer a algiuen es parte del código conexión de un cliente ftp en VB)

Un saludo.
--------------------------

Private Sub Command1_Click(Index As Integer)
Call LogOn
end Sub

Private Sub Inet1_StateChanged(ByVal State As Integer)
On Error GoTo errhandler
Dim Data1 As String, Data2 As String

Select Case State

Case icResolvingHost
lblStatus.Caption = "Looking up host computer IP address"
Case icHostResolved
lblStatus.Caption = "IP address found"
Case icConnecting
lblStatus.Caption = "Connecting to host computer"
Case icReceivingResponse
lblStatus.Caption = "Receiving a response from host"
Case icResponseReceived
lblStatus.Caption = "Response received"
Case icDisconnecting
lblStatus.Caption = "Disconnecting from host computer"
Case icDisconnected
lblStatus.Caption = "Disconnected from host computer"
Case icError
lblStatus.Caption = "Error " & Inet1.ResponseCode & Inet1.ResponseInfo

Case icResponseCompleted
lblStatus.Caption = "Request completed successfully"
Do While True
'Change datatype to icByteArray to receive data in binary
Data1 = Inet1.GetChunk(512, icString)
If Len(Data1) = 0 Then Exit Do
DoEvents
Data2 = Data2 & Data1
Loop
txtDir.Text = Data2


End Select
Exit Sub
errhandler:
MsgBox Err.Source & " " & Err.Number & " " & Err.Description
End Sub

Public Sub LogOn()
Command1(0).Enabled = False
Inet1.Protocol = icFTP
Inet1.URL = txtURL.Text
Inet1.UserName = txtUserName.Text
Inet1.Password = txtPassword.Text
Inet1.Execute , "DIR"
End Sub
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:12.