=sinister= Posted February 26, 2009 Share Posted February 26, 2009 I have a simple GUI, and in that GUI I have a button. when the button is pressed it calls the convertCoordinates udf: expandcollapse popupGlobal $retour, $xul, $xlr, $yul, $ylr Func convertCoordinates($wowzoneID, $wowXcoord, $wowYcoord) For $i = 1 To _FileCountLines("./Database.txt") $Split = StringSplit(FileReadLine("./Database.txt", $i), ",") Global $uselessID = $Split[1] Global $continentID = $Split[2] Global $zoneID = $Split[3] Global $zoneName = $Split[4] Global $xul = $Split[5] Global $xlr = $Split[6] Global $yul = $Split[7] Global $ylr = $Split[8] If $wowzoneID = $Split[3] Then $pctWidthValue = getWidth() / 100 $pctHeigthValue = GetHeight() / 100 $xValue = $xul - ($pctWidthValue * $wowXcoord) $yValue = $yul - ($pctHeigthValue * $wowYcoord) ExitLoop EndIf Next Return Round($xValue, 1) & ", " & Round($yValue, 1) EndFunc Func getWidth() $retour = 0 $retour = $xul - $xlr If $xul < 0 And $xlr < 0 Then $retour = (0 - $xlr) - (0 - $xul) Return $retour EndFunc Func getHeight() $retour = 0 $retour = $yul - $ylr If $yul < 0 And $ylr < 0 Then $retour = (0 - $ylr) - (0 - $yul) Return $retour EndFunc however, when the udf is called, it changes the value of the button in the GUI to some weird numbers. I don't even have a GUICtrlSetData() in there?! I'm sooooooooo confused. Link to comment Share on other sites More sharing options...
PsaltyDS Posted February 26, 2009 Share Posted February 26, 2009 I have a simple GUI, and in that GUI I have a button. when the button is pressed it calls the convertCoordinates udf: expandcollapse popupGlobal $retour, $xul, $xlr, $yul, $ylr Func convertCoordinates($wowzoneID, $wowXcoord, $wowYcoord) For $i = 1 To _FileCountLines("./Database.txt") $Split = StringSplit(FileReadLine("./Database.txt", $i), ",") Global $uselessID = $Split[1] Global $continentID = $Split[2] Global $zoneID = $Split[3] Global $zoneName = $Split[4] Global $xul = $Split[5] Global $xlr = $Split[6] Global $yul = $Split[7] Global $ylr = $Split[8] If $wowzoneID = $Split[3] Then $pctWidthValue = getWidth() / 100 $pctHeigthValue = GetHeight() / 100 $xValue = $xul - ($pctWidthValue * $wowXcoord) $yValue = $yul - ($pctHeigthValue * $wowYcoord) ExitLoop EndIf Next Return Round($xValue, 1) & ", " & Round($yValue, 1) EndFunc Func getWidth() $retour = 0 $retour = $xul - $xlr If $xul < 0 And $xlr < 0 Then $retour = (0 - $xlr) - (0 - $xul) Return $retour EndFunc Func getHeight() $retour = 0 $retour = $yul - $ylr If $yul < 0 And $ylr < 0 Then $retour = (0 - $ylr) - (0 - $yul) Return $retour EndFunc however, when the udf is called, it changes the value of the button in the GUI to some weird numbers. I don't even have a GUICtrlSetData() in there?! I'm sooooooooo confused. There's no GUI and no button in that code... makes it hard to reproduce your symptoms... Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now