Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automation internet explorer
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01047605
Message ID:
01047617
Views:
10
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform