daslick Posted March 7, 2008 Share Posted March 7, 2008 (edited) I have a listview similar to the following... 1)one two three 2)four five six 3)seven eight nine I am trying to find out which row is selected, then read the data and find which item in a two dim array is equal to that data... I have played around for a LONG time with lines like the following: ;MsgBox(0,'',GUICtrlRead(GUICtrlRead($list))) ;TCPSend($socket[_GUICtrlListView_GetSelectedIndices($list)][0],GUICtrlRead($input)) ;ToolTip(_GUICtrlListView_GetSelectedIndices(GUICtrlRead(GUICtrlRead($list)))) ;MsgBox(0,_GUICtrlListView_GetSelectedIndices(GUICtrlRead(GUICtrlRead($list))),'') MsgBox(0,'',_GUICtrlListView_FindText($list,GUICtrlRead($list))) _ArraySearchAnyDim($socket,StringReplace(GUICtrlRead(GUICtrlRead($list)),'|','',-1),0,0,0,"[x][2]") The problem is that GUICtrlRead(GuiCtrlRead($list)) returns the array like one|two|three... Does anyone have any ideas? Edited March 7, 2008 by daslick Link to comment Share on other sites More sharing options...
martin Posted March 8, 2008 Share Posted March 8, 2008 The problem is that GUICtrlRead(GuiCtrlRead($list)) returns the array like one|two|three...What do you want to get if not "one|two|three"? Presumably "onetwothree" isn't what you want either.The parameter -1 in your StringReplace is probably doing nothing I expect. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
daslick Posted March 8, 2008 Author Share Posted March 8, 2008 I have no idea how I ended up with it, but I ended up solving this problem with the following line of code. TCPSend($socket[_ArraySearchAnyDim($mainsocket,StringTrimRight(GUICtrlRead(GUICtrlRead($listview)),1),0,0,0,"[x][2]")][0],$data_to_send) If anyone experiences a similar problem they should search for and use the _ArraySearchAnyDim function as I did. 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