Jump to content

Duplicate function name


Recommended Posts

Could someone please explain to me how you can use Func_SearchLastState more than once in the same script.

My situation is I am trying to use it in the same script under different case scenarios:

e.g.

Case 1

Func_SearchLastState($sMachine)

Case 2

Func_SearchLastState($sLaptop)

 

Even though these are under different case scenarios the Func_SearchLastState is getting picked up as a duplicate function name.

How can I use this function more than one in my script without getting the error?

Link to comment
Share on other sites

You are declaring two functions with the same name by using the keyword "Func".  The $sMachine and $sLaptop are arguments for that function.  I am not sure where you got the _SearchLastState function - but you don't need to keep declaring it with that keyword.  Instead, just do _SearchLastState($sMachine) and _SearchLastState($sLaptop).  Posting the whole script would also help give you a more precise answer.

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

Link to comment
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
 Share

×
×
  • Create New...