how to prevent error message (duplicate function definition)

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
zhu25
Posts: 9
Joined: 01 Feb 2021, 13:52

how to prevent error message (duplicate function definition)

17 Jun 2021, 13:43

Hi

Having a bit of a headache trying to figure out how to make the same code work for 2 different actions.
Im using the findtext (by capturing image) code and i want to use it for several different captures in one script, but then I get the error message for the second capture, when i try to run the script and so it says Error (duplicate definition code) because "findtext(x, y, w, h, err1, err0...." is the same function, but i want it to use it for 2 different captures

What should I add/change to prevent this error from stopping the script? :idea:
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: how to prevent error message (duplicate function definition)

17 Jun 2021, 13:51

don't copypaste the whole function declaration+implementation(the long code)

just call the function where u need to, however many times u need to. if u don't know what this means, head over to the ahk docs and lookup "functions", it explains everything

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], makdc96, RandomBoy and 178 guests