Philip Amos Posted September 22, 2006 Share Posted September 22, 2006 I am querying a control box in a program which contains a list of text similar to below, I am able to get this information read into a variable and displaying it in a large MSGBOX.Object AObject BObject C...Object XWhat I want to be able to do if write a peice of script which enters each line of the control box into an array so that I can manipulate each entry.Any help woul dbe great.Thank youPhilip Link to comment Share on other sites More sharing options...
GaryFrost Posted September 22, 2006 Share Posted September 22, 2006 I am querying a control box in a program which contains a list of text similar to below, I am able to get this information read into a variable and displaying it in a large MSGBOX.Object AObject BObject C...Object XWhat I want to be able to do if write a peice of script which enters each line of the control box into an array so that I can manipulate each entry.Any help woul dbe great.Thank youPhilipStringSplit should work with the way your doing it now.Not enough info to help any more. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Blue_Drache Posted September 22, 2006 Share Posted September 22, 2006 Yes, stringsplit will work... So will _FileReadToArray() #include <file.au3> Dim $aRecords If Not _FileReadToArray("error.log",$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf For $x = 1 to $aRecords[0] Msgbox(0,'Record:' & $x, $aRecords[$x]) Next Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
GaryFrost Posted September 22, 2006 Share Posted September 22, 2006 Yes, stringsplit will work...So will _FileReadToArray()curious how this would work from control box in a program SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 22, 2006 Share Posted September 22, 2006 (edited) I am querying a control box in a program which contains a list of text similar to below, I am able to get this information read into a variable and displaying it in a large MSGBOX. Object A Object B Object C ... Object X What I want to be able to do if write a peice of script which enters each line of the control box into an array so that I can manipulate each entry. Any help woul dbe great. Thank you Philip If you run the following, what do you get? #include <array.au3> $WinTitle = "Title of Window" ; <=== Edit for title $CtrlID = 1234 ; <=== Edit for control ID $TextIn = ControlGetText($WinTitle, "", $CID) MsgBox(64, "Read Data", "Text = " & $TextIn) $SplitArray = StringSplit($TextIn, @CRLF) _ArrayDisplay($SplitArray, "$SplitArray") The interesting thing will be how lines are delimited. The above code uses @CRLF, but it might be just @CR or @LF, or some other character. P.S. It matters what kind of control, to. For example a listview can be read one item at a time by ControlListView() commands. Edited September 22, 2006 by PsaltyDS 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