![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Feb 2005
Posts: 62
Rep Power: 4
![]() |
reading from a listbox
i can't find any information on how to do this whatsoever anywhere on the internets.
a user selects multiple(!) not necessarily consecutive items from a dirlistbox and clicks a button, which ideally would write the contents of each selected line to a text file. now, i can do dirlistbox.text and dirlistbox.listindex for reading a single selection, but each command only reads the last selection entered, and even if i manually set dirlistbox.selected(dirlistbox.listindex) = false 'sets whatever was last selected to false any ideas? ![]() Last edited by chepfaust; Feb 19th, 2005 at 2:45 PM. |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Feb 2005
Posts: 4
Rep Power: 0
![]() |
try to use an array...put the selections in the array.
and try to check first how many items the user has selected. hope this helps |
|
|
|
|
|
#3 | ||
|
Programming Guru
![]() ![]() |
Quote:
Anyways, to do what you want (or at least what i think you want to do), you would use the Selected property of the Listbox and a loop of your choosing. He's some more info about the selected property. Quote:
for x=0 to (myListBox.ListCount - 1) Step 1
if (myListBox.Selected == true) then
'do something with the item, like put it an array for later
'use, or you could even write it to the text file from here.
end if
Next xanyways, if i read your post right, that sould be what you need. you could use a do while loop or any other loop you want, but i jus tplain like for loops :-)
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! Last edited by Pizentios; Feb 22nd, 2005 at 9:20 AM. |
||
|
|
|
|
|
#4 | |
|
Programmer
Join Date: Feb 2005
Posts: 62
Rep Power: 4
![]() |
Quote:
i have no experience with using arrays but it sounds promising so i'll have to read up on that. thanks for the suggestions though. edit: OH MY GOD if i had known about arrays and their capabilities earlier in this project, it would have saved me many hours' worth of toil and made my program run more efficiently to boot. i'm starting over now. lol Last edited by chepfaust; Feb 27th, 2005 at 1:54 AM. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|