Jump to content

Recommended Posts

Posted

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?

Posted

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

Posted (edited)

Thank you very much for the feedback. After reading your response a couple of times I realized where I was going wrong. Thank you again for taking the time to respond! :)

 

Edited by boltonebob

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
×
×
  • Create New...