MisterC Posted November 16, 2009 Posted November 16, 2009 Hello peops, Im just messing arrount with autoit to learn the code a bit and tried sorting data in edit boxes by changing a script a bit. expandcollapse popup#include <E:\AutoIt3\Include\ButtonConstants.au3> #include <E:\AutoIt3\Include\EditConstants.au3> #include <E:\AutoIt3\Include\GUIConstantsEx.au3> #include <E:\AutoIt3\Include\StaticConstants.au3> #include <E:\AutoIt3\Include\WindowsConstants.au3> #include <E:\AutoIt3\Include\Array.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 633, 379, 192, 114) $Edit1 = GUICtrlCreateEdit("", 8, 24, 121, 305) GUICtrlSetData(-1, "") $Edit2 = GUICtrlCreateEdit("", 160, 24, 121, 305) GUICtrlSetData(-1, "") $Edit3 = GUICtrlCreateEdit("", 312, 24, 121, 305) GUICtrlSetData(-1, "") $Button1 = GUICtrlCreateButton("Button1", 184, 344, 75, 25, 0) $Group1 = GUICtrlCreateGroup("Group1", 480, 8, 137, 329) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 local $z $x = guictrlread($Edit1) $y = guictrlread($Edit2) $file1 = StringReplace($x, @CRLF, "*!*") $file2 = StringReplace($y, @CRLF, "*!*") $array1 = StringSplit($file1, "*!*") $array2 = StringSplit($file2, "*!*") For $i = 1 To $array1[0] For $j = 1 To $array2[0] If StringLower($array1[$i]) = StringLower($array2[$j]) Then $array1[$i] = "" $array2[$j] = "" ExitLoop EndIf Next Next _ArrayDisplay($array1) _ArrayDisplay($array2) For $i = 1 To $array1[0] If $array1[$i] <> "" Then FileWriteLine($z, $array2[$i]) Next GUICtrlSetData ($Edit3, $z) EndSwitch WEnd I just can't figure out how to get the end data. just using GUICtrlSetData ($Edit3, $z) doesn't work. Ány idea's ? Greetings -C-
whim Posted November 16, 2009 Posted November 16, 2009 FileWriteLine($z, $array2[$i]) $z needs to be a file handle or filename here, an uninitilised local variable won't cut it ... maybe you meant $z = $array2[$i] there ? whim
MisterC Posted November 16, 2009 Author Posted November 16, 2009 Atleast it gives me a output, not the output I would like but it's something tnx
MisterC Posted November 16, 2009 Author Posted November 16, 2009 Atleast it gives me a output, not the output I would like but it's something tnxCan't get it to do anything usefull, anyone has a idea what i'm doing wrong here ?
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