JesusIsKing Posted December 16, 2007 Author Share Posted December 16, 2007 Remove your GUICtrlCreateListViewItem and replace _GUICtrlListGetText() with: GUICtrlCreateListViewItem(_GUICtrlListGetText($Listbox, $u_count), $sListview) But I'm sure you're going to want to do something with what's in the listview afterwards, so on to the "next" question, "How do I put what is selected in the ListView into a variable for use"... Now if you seriously ask that question... You need to stick your nose in the Help file until you can achieve some of the medial things that the help file (if actually read and comprehended) would provide for you. Ok it didn't put the items from the listbox into my listview, but it did put two -1's in my listview. Why did it do that? Link to comment Share on other sites More sharing options...
JesusIsKing Posted December 16, 2007 Author Share Posted December 16, 2007 Remove your GUICtrlCreateListViewItem and replace _GUICtrlListGetText() with: GUICtrlCreateListViewItem(_GUICtrlListGetText($Listbox, $u_count), $sListview) But I'm sure you're going to want to do something with what's in the listview afterwards, so on to the "next" question, "How do I put what is selected in the ListView into a variable for use"... Now if you seriously ask that question... You need to stick your nose in the Help file until you can achieve some of the medial things that the help file (if actually read and comprehended) would provide for you. Ok it didn't put the items from the listbox into my listview, but it did put two -1's in my listview. Why did it do that? Link to comment Share on other sites More sharing options...
JesusIsKing Posted December 16, 2007 Author Share Posted December 16, 2007 If someone is willing I could give them the link to the app im testing it on and my code and they could try it and see if they can get it to work. Just an idea... Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 16, 2007 Moderators Share Posted December 16, 2007 Ok it didn't put the items from the listbox into my listview, but it did put two -1's in my listview. Why did it do that?Again... you'd be amazed at what you found in the help file.If it's putting -1, my first assumption would be .... Hmmm - _GUICtrlListGetText($Listbox, $u_count) is where I'm getting my value, so then I would open up my help file and look at _GUICtrlListGetText() to see what it actually says it will return for "Success" and "Failure".Now if I did something so silly as look in the help file, rather than annoy the hell out of everyone on the forum because I'm too lazy too... I'd probably find:The return value is the item stringIf $i_index does not specify a valid index, the return value is $LB_ERR.Then I'd probably look through the constants in my Program Files\AutoIt3\Include\ListBoxConstants.au3, and I'd quickly find the value for $LB_ERR which is -1, and now I'd have a place to concentrate on. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
JesusIsKing Posted December 16, 2007 Author Share Posted December 16, 2007 Again... you'd be amazed at what you found in the help file.If it's putting -1, my first assumption would be .... Hmmm - _GUICtrlListGetText($Listbox, $u_count) is where I'm getting my value, so then I would open up my help file and look at _GUICtrlListGetText() to see what it actually says it will return for "Success" and "Failure".Now if I did something so silly as look in the help file, rather than annoy the hell out of everyone on the forum because I'm too lazy too... I'd probably find:Then I'd probably look through the constants in my Program Files\AutoIt3\Include\ListBoxConstants.au3, and I'd quickly find the value for $LB_ERR which is -1, and now I'd have a place to concentrate on. How would I get a valid index. I used $Listbox in _GUICtrlListCount() and its the variable for the window that contains the listbox.my code is $Listbox = ControlGetHandle("Find Player", "", 259) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 17, 2007 Moderators Share Posted December 17, 2007 How would I get a valid index. I used $Listbox in _GUICtrlListCount() and its the variable for the window that contains the listbox. my code is $Listbox = ControlGetHandle("Find Player", "", 259)1. You're using an old version of AutoIt, but you've been told this under your other name before (and after a month, I can't believe you still don't have it). 2. Because you are using an older version of autoit, those GUI Functions you are using are for AutoIt GUI controls only. Case in point$Listbox = ControlGetHandle("Find Player", "", 259) $i_count = _GUICtrlListCount($Listbox) MsgBox(0, 0, $i_count)I'd bet anything, you get -1 there. Don't ask what you should use... just download the newest version and start over.... End of discussion until you can post a question that you actually showed to the forum you put an effort in trying to understand rather than having someone do the work for you. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
JesusIsKing Posted December 17, 2007 Author Share Posted December 17, 2007 1. You're using an old version of AutoIt, but you've been told this under your other name before (and after a month, I can't believe you still don't have it). 2. Because you are using an older version of autoit, those GUI Functions you are using are for AutoIt GUI controls only. Case in point$Listbox = ControlGetHandle("Find Player", "", 259) $i_count = _GUICtrlListCount($Listbox) MsgBox(0, 0, $i_count)I'd bet anything, you get -1 there. Don't ask what you should use... just download the newest version and start over.... End of discussion until you can post a question that you actually showed to the forum you put an effort in trying to understand rather than having someone do the work for you. My script is too big to start over. Link to comment Share on other sites More sharing options...
JesusIsKing Posted December 17, 2007 Author Share Posted December 17, 2007 Could someone help me out and code a sample for me to go by and make this work. I really want to solve this problem. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 17, 2007 Moderators Share Posted December 17, 2007 I warned you about bumping this thread within a 24 hour period. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Recommended Posts