Jump to content

For Loop


Recommended Posts

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

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)

NEWHeader1.png

Link to comment
Share on other sites

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

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 by Valuater

NEWHeader1.png

Link to comment
Share on other sites

*******************************

.... 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

*******************************

.... 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

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 Here

Aren't I a tiddle taddle .. buwahaha

Cheers

Edit: I'm surprised Jos hasn't spotted this already...

Edited by smashly
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...