Gathering items from listview

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.

I can return individual items from a listview box by single or double clicking but I was wondering if there is any way to gather ALL of the items from the list for processing.

I assume that the list is a pseudo linked list and there is some way of addressing all of the elements?

Regards

Fangles
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.
I can return individual items from a listview box by single or double clicking but I was wondering if there is any way to gather ALL of the items from the list for processing.

I assume that the list is a pseudo linked list and there is some way of addressing all of the elements?
Why not trying a loop with GetGadgetText(x) ? Just a tough :). And if it's internally handled as a linked list (don't know) you will never add access.. Windows is smart enough (!) to hide all its internal routine for the programmer.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.
Why not trying a loop with GetGadgetText(x) ? Just a tough :). Fred - AlphaSND
Hmm, give me a few moments, cross your fingers, eyes legs and I'll see if I can do it :)

Fangles
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Fangbeast.
Why not trying a loop with GetGadgetText(x) ? Just a tough :). Fred - AlphaSND
Hmm, give me a few moments, cross your fingers, eyes legs and I'll see if I can do it :)
[/quote]

Procedure CopyMatches(CopyTo$)
Shared Counter
For CopyStart = 1 To Counter
SetGadgetState(7, CopyStart)
Temporary$ = GetGadgetText(7)
FileName$ = GetFilePart(Temporary$)
NewName$ = CopyTo$ + FileName$
If RenameFile(Temporary$, NewName$)
EndIf
Next CopyStart
EndProcedure

Okay, this works fine to copy files out of the list, fun to watch too :)


Fangles
Post Reply