Jump to content

Recommended Posts

Posted

The best example is MouseClick, where you have MouseClick($Button, [$x, $y, [..........]]) Where if X is set, Y must be set too.

I do know how to make it so that X and Y are optional, but I am not sure how to get Y mandatory if X is set. I did check the help, but didn't see anything there.

Thanks in advance

Posted

You know how you can do MouseClick and not specify a position argument? It will just click where ever the mouse is. If you want to specify a position, you have to specify both X and Y. It is optional to specify an X and Y, but if you do, they both have to be.

Posted

Something like this ?

Func Function($x = Default, $y = Default)
    If ($x <> Default AND $y = Default) OR ($x = Default AND $y <> Default) Then
        Return SetError(1, 0, 0)
    ElseIf $x = Default Then
        ConsoleWrite("X and Y not set")
    Else
        ConsoleWrite("X and Y set")
    EndIf
EndFunc

 

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...