Jump to content

Recommended Posts

Posted

So you want to enter (50, 30) and get back (30, 50)? This code will do that, but it has absolutely no error checking.

Local $point = InputBox("Enter a point", "Format: (x, y)" & @CRLF & "Min: 100" & @CRLF & "Max: 100")
MsgBox(64, "The inverted point's coordinates are:", _InvertPoint($point))

Func _InvertPoint($sPoint)
    Local $aPoint = StringSplit(StringRegExpReplace(StringStripWS($sPoint, 8), "\(|\)", ""), ",", 2)
    $sPoint = "(" & $aPoint[1] & ", " & $aPoint[0] & ")"
    Return $sPoint
EndFunc

Thanks, this code is great, If I need to I could try to add some error checking.

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