Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automation internet explorer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01047605
Message ID:
01047617
Vues:
9
Steve,

The problem is that Navigate is an asynchonous call, so it returns inmediately while not ready yet, you need to put a pause there, something like
oIE = createobject('internetexplorer.application')
? oIE.ReadyState
oIE.Navigate('www.tek-tips.com')
lnStart = seconds()
lnTimeOut = 5
do while (oIE.ReadyState # 4) and seconds() - lnStart <= lnTimeOut
enddo
if oIE.ReadyState = 4
  ? oie.document.body.innertext
else
  ? 'timed out'
endif
You must take care of midnight in the seconds() - lnStart expression, and notice also that you'll get an HTML even if the address is wrong, you'll get the 404 HTML. Also you can put a Sleep(lnInteval) in the loop to free up the CPU
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform