inet1 issues quick question
hi there i have a form that does this. ( in a nutshell )
inet1.host = "host here"
inet1.execute blah blah blah
inet1.execute blah blah blah
inet1.execute blah blah blah
inet1.execute blah blah blah
i need it to WAIT between the executes... until the first one is done before it moves onto the next one... how can i do that? Thanks
[364 byte] By [
vchatlive] at [2007-11-11 10:09:50]

# 1 Re: inet1 issues quick question
One approach is to use a "finite state machine": Create a form-level variable to track the current state. Call the first .Execute method, then add code to the Inet control's StateChanged event to detect that the operation is complete. In the StateChanged event, update the form-level state variable, then call the next .Execute method. Something like this:
Option Explicit
Private Enum eFtpState
Step1
Step2
Step3
End Enum
Private FtpState As eFtpState
Private Sub Form_Load()
FtpState = Step1
DoFtp
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
If State = icResponseCompleted Then
Select Case FtpState
Case Step1
FtpState = Step2
DoFtp
Case Step2
FtpState = Step3
DoFtp
End Select
End If
End Sub
Private Sub DoFtp()
Select Case FtpState
Case Step1
Inet1.Execute "Step1"
Case Step2
Inet1.Execute "Step2"
Case Step3
Inet1.Execute "Step3"
End Select
End Sub
# 2 Re: inet1 issues quick question
very interesting, i ended up with a do until statement,
execute blah blah blah
do until inet1.stillexecuting = flase
do events
loop
execute blah blah
and it seemed to work jsut fine.
any advantages to the code above?
# 4 Re: inet1 issues quick question
got it figured out added if statement for if its workign go to next1, next 2 etc.