Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pause code until operation is completed
Message
De
31/01/2002 23:29:27
 
 
À
30/01/2002 22:08:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00613179
Message ID:
00613831
Vues:
17
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform