Jump to content
Sign in to follow this  
namauto

Unreliable Loops?

Recommended Posts

namauto

I've tried doing this as both a for, and a while loop. I'm getting similar issues.

For $i = 0 to 5 Step +1
        _IELoadWait($o_page)
        $refresh = _IEAction($o_page, "refresh")
    Next

That's how I did it in the For loop. now sometimes the page is refreshing 6 times, and sometimes it's refreshing 7 times, without any changes in the script between runs.

Any idea as to the cause of this?

Share this post


Link to post
Share on other sites
Bert

Add a sleep(10) in the loop and see what happens. Not sure why it is happening, but the sleep may make it more stable.

This is from the helpfile, and it may be the reason why it is happening:

Browser scripting security restrictions may sometimes prevent _IELoadWait from guaranteeing that a page is fully loaded and can occasionally result in untrapped errors. In these cases you may need to avoid calling _IELoadWait and attempt to employ other methods of insuring that the page load has completed. These methods might include using a Sleep command, examining browser status bar text and other methods. When using functions that call _IELoadWait for objects other than the InternetExplorer (browser) object, you may also be successful by calling _IELoadWait for the browser yourself (e.g. _IELoadWait($oIE)).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.