taurus905 Posted November 28, 2006 Share Posted November 28, 2006 I would appreciate any help in understanding the behavior of the following short example script. I am trying to capture data that is copied and pasted in to an edit box and write it to an .ini file. Please try the following: #include <GUIConstants.au3> ; Data to copy and paste in to Edit Box: #cs 123 456 789 #ce GUICreate("Enter data to write to .ini file.", 200, 300, -1, -1) $Input= GuiCtrlCreateEdit("", 10, 10, 100, 200) $Button_Ok = GUICtrlCreateButton("Ok", 50, 250, 50, 25) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $Button_Ok $Input_Split = StringSplit(GUICtrlRead($Input), @CR) For $i = 1 To $Input_Split[0] MsgBox(0, $i, $Input_Split[$i]) IniWrite("Edit Test.ini", "Data", $i, $Input_Split[$i]) Next Exit Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEndI would welcome a better way to accomplish this task, but I would still be curious to why this method does not work correctly. Thanks to anyone who can help me figure this one out. taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Lapo Posted November 28, 2006 Share Posted November 28, 2006 (edited) Quick test and all OK here Win98se + Autoit 3, 2, 1, 11 EDIT: NO it's NOT ok un multiline .. no time ti chek it now PS: try $Input_Split = StringSplit(GUICtrlRead($Input), @CRLF) Edited November 28, 2006 by Lapo Link to comment Share on other sites More sharing options...
taurus905 Posted November 28, 2006 Author Share Posted November 28, 2006 Quick test and all OK here Win98se + Autoit 3, 2, 1, 11EDIT:NO it's NOT ok un multiline .. no time ti chek it nowLapo,Thanks for trying my example and confirming that it does not work as expected.taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Lapo Posted November 28, 2006 Share Posted November 28, 2006 (edited) Lapo,Thanks for trying my example and confirming that it does not work as expected.taurus905see the edit on the above post here againtry $Input_Split = StringSplit(GUICtrlRead($Input), @CRLF)and maybe split out NullLines Edited November 28, 2006 by Lapo Link to comment Share on other sites More sharing options...
taurus905 Posted November 28, 2006 Author Share Posted November 28, 2006 PS: try $Input_Split = StringSplit(GUICtrlRead($Input), @CRLF)Lapo, I thought of that and did not try it. The outputted data looks like this:1=123 2= 3=456 4= 5=789 But I can work with that. Thanks again. taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs Link to comment Share on other sites More sharing options...
Lapo Posted November 28, 2006 Share Posted November 28, 2006 (edited) But I can work with that.Maybe :$Input_Split = StringSplit(GUICtrlRead($Input), @LF) Edited November 28, 2006 by Lapo Link to comment Share on other sites More sharing options...
taurus905 Posted November 28, 2006 Author Share Posted November 28, 2006 Maybe :$Input_Split = StringSplit(GUICtrlRead($Input), @LF)Lapo,Perfect. That did the trick.Thanks for taking the time to help me.taurus905 "Never mistake kindness for weakness."-- Author Unknown --"The highest point to which a weak but experienced mind can rise is detecting the weakness of better men."-- Georg Lichtenberg --Simple Obfuscator (Beta not needed.), Random names for Vars and Funcs 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