|
-
May 15th, 2001, 09:57 AM
#1
whiles, files, and listboxes
I'm trying to get a list of items in a text file to be displayed in a listbox control. unfortunatly I don't know exactly how. This is what I have and it doesn't do it. By the way if it makes a difference, the file could hold nothing before #endlist#
'loading items from file into array
While buffer <> "#endlist#"
input filenum, buffer
list(i) = buffer
i = i + 1
Wend
'from the array into the listbox
While buffer <> "" and i <= listMax
lstBox.AddItem(list(i))
i = i + 1
Wend
these are both just snippets of code, they DO NOT come directly after each other
now all this does is give me a headache and displays the "#endlist#" in the listbox. help... 
-
May 15th, 2001, 10:08 AM
#2
Re: whiles, files, and listboxes
Here is an example how to put every string from the text file to listbox
Open "c:\temp\temp.txt" For Input As #1 'to read from
Do While Not EOF(1)
Line Input #1, sLine
List1.AddItem sLine
Loop
Close #1
'You might want to extract some data from sLine. You can do it before adding to the listbox
Iouri Boutchkine
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|