Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pause code until operation is completed
Message
From
31/01/2002 23:29:27
 
 
To
30/01/2002 22:08:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00613179
Message ID:
00613831
Views:
16
>I use the following code to get data from the internet.
>
> x = NEWOBJECT("_webform", HOME()+"\gallery\_webview")
> x.olewebbrowser.navigate2("http://quote.yahoo.com")
> x.show()
>
> *** subsequent code follows which uses the data that is downloaded.
>
>The problem is that the subsequent code runs before I get the data downloaded.
>
>I can put the web access in one command button and the subsequent code under another command button and have it two step process. However, I would prefer to have the user click only one command button.
>
>Any thoughts would be appreciated
>
>Thanks
>Gaylen Jungling

You can check the WebBrowser control's readystate property, and wait until it = 4, and then check the WB.Document.ReadyState property and wait till it equals "complete". This will take a 2 step polling process:

DO WHILE x.olewebbrowser.readystate <> 4
ENDDO

DO WHILE x.olewebbrowser.document.readystate <> "complete"
ENDDO

Of course, you'll want to put an escape hatch in those loops in the case where the page is unavailable.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform