Duplicate function definition error

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
jbearnolimits
Posts: 58
Joined: 09 Jul 2017, 23:44

Duplicate function definition error

23 Aug 2017, 12:56

I am getting a Duplicate function definition error when trying to run my script. I am trying to use the IELoad(wb) function to wait for a page to load, but in my script I am navigating through multiple pages and have to use the same code over and over. Is this something not allowed, is there a way to fix this issue? I can't run the script because of it. Here is the code, I have it in multiple places in the script:

IELoad(wb) ;You need to send the IE handle to the function unless you define it as global.
{
If !wb ;If wb is not a valid pointer then quit
Return False
Loop ;Otherwise sleep for .1 seconds untill the page starts loading
Sleep,100
Until (wb.busy)
Loop ;Once it starts loading wait until completes
Sleep,100
Until (!wb.busy)
Loop ;optional check to wait for the page to completely load
Sleep,100
Until (wb.Document.Readystate = "Complete")
Return True
}
Rindis
Posts: 213
Joined: 23 Dec 2013, 13:58
Location: Norway
Contact:

Re: Duplicate function definition error

24 Aug 2017, 00:04

Hi

you cannot have the same function several places in your script. The whole point of functions are the write it once use it many times. So you can have many function calls i.e

IELoad(http://www.google.com)
....
IELoad(yahoo.com)
...and so on
All pointing to the same function

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], SimmoF, uchihito and 218 guests