sijimbo Posted August 12, 2009 Posted August 12, 2009 I am new to AutoIT and attempting to import text from a GUICTRLCREATEEDIT field into an array. I want each line of text to be in imported into a separate Array field Text line 1 ====> array[0] Text line 2 ====> array[1] Text line 3 ====> array[2] etc............. Any help will be appreciated thanks.
WolfWorld Posted August 12, 2009 Posted August 12, 2009 I am new to AutoIT and attempting to import text from a GUICTRLCREATEEDIT field into an array. I want each line of text to be in imported into a separate Array field Text line 1 ====> array[0] Text line 2 ====> array[1] Text line 3 ====> array[2] etc............. Any help will be appreciated thanks. Use $sInput = GuiCtrlRead($hHandle ...) And Use $aSplit = StringSplit($sInput, @CRLF, 3) Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets!
Valuater Posted August 12, 2009 Posted August 12, 2009 Maybe... #include <array.au3> GUICreate("My GUI") $Edit1 = GUICtrlCreateEdit("", 10, 10, 300, 200) GUICtrlSetData(-1, "Type in your lines") $Button1 = GUICtrlCreateButton("Click Here", 100, 300, 150, 30) GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then Exit If $msg = $Button1 Then $array = StringSplit(StringStripCR(GUICtrlRead($Edit1)), @LF) _ArrayDisplay($array) EndIf WEnd 8)
sijimbo Posted August 12, 2009 Author Posted August 12, 2009 Thank you athiwatc and Valuater. Your suggestions have helped me resolve my little problem. I ended up using GUICtrlRead to input to a variable and then ran the variable through StringSplit using commas as delimiters, but I like that function StringStripCR to remove carriage values. I'll have to study the Help files more. This forum has been very helpful. Thank you.
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