|
-
Jun 4th, 2002, 09:52 PM
#1
Thread Starter
Hyperactive Member
Loop help needed
can anyone help me with this coding? i'm trying to get Loop to check if the browser is still busy and if its been busy for
more than 3 secs to stop
VB Code:
Dim gStart As Long
gStart = Timer
Do
DoEvents
Loop Until If Not WebBrowser1.Busy = True Then
End If
ElseIf InStr(1, WebBrowser1.LocationURL, "user?/nemx") <> 0 And Timer - gStart > 3 And
Not WebBrowser1.Busy = False Then
WebBrowser1.Stop
End If
-
Jun 4th, 2002, 10:40 PM
#2
Hyperactive Member
Well, to check for the browser is still loading something, this will work for most cases:
Code:
Do
DoEvents
Loop Until wb.ReadyState = READYSTATE_COMPLETE
any other questions?
-
Jun 4th, 2002, 10:43 PM
#3
Hyperactive Member
I don't think you can use an 'IF' statement in your Do-Loop condition.
Your Do-Loop should be either:
Do
Loop Until WebBrowser1.Busy = True
OR
Loop Until WebBrowser1.Busy = False
The IF Then statement should be inside the Do-Loop somewhere, if I follow your logic correctly.
-
Jun 4th, 2002, 10:50 PM
#4
Hyperactive Member
I didn't realize what you wanted to do. This code should suit you better =0
Code:
timer1.interval = 3000
timer1.enable = true
Do
DoEvents
If bolTimesUp Then Exit Do
Loop Until wb.ReadyState = READYSTATE_COMPLETE
timer1_timer()
timer1.enabled = false
bolTimesUp = True
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|