>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