JesusIsKing Posted November 23, 2007 Share Posted November 23, 2007 Hi, I have a For loop and its skipping whats in it and going to where it says 'Next' For $a = 0 To _GUICtrlListCount($List) - 1 GUICtrlCreateListViewItem(_GUICtrlListGetText($List, $a), $ListView) Next ; it skips GUICtrlCreateListViewItem() and goes straight here Any help would be great. Link to comment Share on other sites More sharing options...
Nahuel Posted November 23, 2007 Share Posted November 23, 2007 Add this ConsoleWrite( _GUICtrlListCount($List) & @CR) before the loop and see what it returns. If it's <= 1 then there you go... Link to comment Share on other sites More sharing options...
JesusIsKing Posted November 23, 2007 Author Share Posted November 23, 2007 Add this ConsoleWrite( _GUICtrlListCount($List) & @CR) before the loop and see what it returns. If it's <= 1 then there you go...I already tried that but with MsgBox() and it says -1 Link to comment Share on other sites More sharing options...
Nahuel Posted November 23, 2007 Share Posted November 23, 2007 -1 is the error ($LB_ERR). Apparently, the listbox has no items and you are trying to create them inside the loop. Link to comment Share on other sites More sharing options...
JesusIsKing Posted November 23, 2007 Author Share Posted November 23, 2007 -1 is the error ($LB_ERR). Apparently, the listbox has no items and you are trying to create them inside the loop.maybe im trying to create the loop before the list items load into the listox. im going to try to make it sleep for a few seconds. Link to comment Share on other sites More sharing options...
JesusIsKing Posted November 23, 2007 Author Share Posted November 23, 2007 still not working... Link to comment Share on other sites More sharing options...
JesusIsKing Posted November 23, 2007 Author Share Posted November 23, 2007 (edited) any help? edit: im using 3.2.8.1 Edited November 23, 2007 by JesusIsKing Link to comment Share on other sites More sharing options...
JesusIsKing Posted November 23, 2007 Author Share Posted November 23, 2007 help would be nice Link to comment Share on other sites More sharing options...
Nahuel Posted November 23, 2007 Share Posted November 23, 2007 Spamming your thread won't make people help you faster. I told what you problem was. Your list box has NO items. Do you even know how a For...To...Next loop works? Link to comment Share on other sites More sharing options...
JesusIsKing Posted November 23, 2007 Author Share Posted November 23, 2007 of course i know how one works. and there are items in the listbox. Link to comment Share on other sites More sharing options...
Valuater Posted November 23, 2007 Share Posted November 23, 2007 What you are trying to do is not possible, you are trying to create an item from something that isn't there yet this works #include <GUIConstants.au3> GUICreate("listview items") $listview = GUICtrlCreateListView ("col1 |col2|col3 ",10,10,200,150) $Items = StringSplit("This|Way,No|That|Direction,Other|Might|Work,No,Yes,Dont Ask", ",") For $a = 1 To $Items[0] GUICtrlCreateListViewItem($Items[$a], $ListView) Next GUISetState() Do $msg = GUIGetMsg () Until $msg = $GUI_EVENT_CLOSE 8) Link to comment Share on other sites More sharing options...
JesusIsKing Posted November 23, 2007 Author Share Posted November 23, 2007 What you are trying to do is not possible, you are trying to create an item from something that isn't there yet this works #include <GUIConstants.au3> GUICreate("listview items") $listview = GUICtrlCreateListView ("col1 |col2|col3 ",10,10,200,150) $Items = StringSplit("This|Way,No|That|Direction,Other|Might|Work,No,Yes,Dont Ask", ",") For $a = 1 To $Items[0] GUICtrlCreateListViewItem($Items[$a], $ListView) Next GUISetState() Do $msg = GUIGetMsg () Until $msg = $GUI_EVENT_CLOSE 8) your code doesn't demonstrate anything close to what im trying to do. and that is getting all the items from a list in another application and taking those items and putting it into my listview. anyone know how to do that? Link to comment Share on other sites More sharing options...
Valuater Posted November 23, 2007 Share Posted November 23, 2007 (edited) your code doesn't demonstrate anything close to what im trying to do. and that is getting all the items from a list in another application and taking those items and putting it into my listview. anyone know how to do that? ******************************* Hi, I have a For loop and its skipping whats in it and going to where it says 'Next' For $a = 0 To _GUICtrlListCount($List) - 1 GUICtrlCreateListViewItem(_GUICtrlListGetText($List, $a), $ListView) Next ; it skips GUICtrlCreateListViewItem() and goes straight here Any help would be great. I already tried that but with MsgBox() and it says -1 maybe im trying to create the loop before the list items load into the listox. im going to try to make it sleep for a few seconds. still not working... any help? edit: im using 3.2.8.1 help would be nice of course i know how one works. and there are items in the listbox. .... Now, How in the hell are we supposed to know that you were trying to read some other listbox????? Where's the Frigging clue????? 8) Edited November 23, 2007 by Valuater Link to comment Share on other sites More sharing options...
Monamo Posted November 23, 2007 Share Posted November 23, 2007 *******************************.... Now, How in the hell are we supposed to know that you were trying to read some other listbox?????Where's the Frigging clue?????8)I'm glad you responded before me - Your wording was a lot gentler than what popped into my head.grumble grumble... help me now! grumble... insufficient info grumble... help file grumble... - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
JesusIsKing Posted November 23, 2007 Author Share Posted November 23, 2007 ******************************* .... Now, How in the hell are we supposed to know that you were trying to read some other listbox????? Where's the Frigging clue????? 8) Here's how I am trying to do it but nothing happens: Case $msg = $FindBuddies ; when i click the button to copy all the list items into my listview If WinExists("Full Tilt Poker - Logged In As", "" ) Then WinActivate("Full Tilt Poker - Logged In As", "") $buddiesSearch = StringSplit($var, ",") Send("{CTRLDOWN}{f}") Send("{CTRLUP}") Sleep(1000) If IsArray($buddiesSearch) Then For $i = 1 To $buddiesSearch[0] Send($buddiesSearch[$i] & "{Enter}") ; Search for each individual player Next For $a = 0 To _GUICtrlListCount($ListBox) - 1 ; this is "supposed" to count and get the index of the list items GUICtrlCreateListViewItem(_GUICtrlListGetText($ListBox, $a), $sListView) ; and this is "supposed" to create all of the list items in the Full Tilt Application into my program Next EndIf Else MsgBox(16, "Error", "Full Tilt isn't running!") EndIf ^^ thats how I'm trying to do it but it doesn't work Link to comment Share on other sites More sharing options...
smashly Posted November 24, 2007 Share Posted November 24, 2007 (edited) I could be wrong but....As a guess "FireLord" = "JesusIsKing" who was posting here the other day in regaurds to the exact same thing and had his thread closed for posting in the exact vagueness and getting tacky with one of the ops.One of the mentioned threads HereAren't I a tiddle taddle .. buwahahaCheersEdit: I'm surprised Jos hasn't spotted this already... Edited November 24, 2007 by smashly 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