|
-
Sep 1st, 2000, 01:02 AM
#1
Thread Starter
Lively Member
How could you import a text file into a listbox where each line in the textfile is a new listbox entry?
___________________________
Chris
-
Sep 1st, 2000, 01:13 AM
#2
transcendental analytic
Code:
Dim ff as integer,buffer as string
ff=freefile
open yourfile for input as ff
line input #ff,buffer
list1.additem buffer
close ff
just make sure yourfile string exist and listbox list1 is there
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Sep 1st, 2000, 01:15 AM
#3
Fanatic Member
Code:
Open "file.txt" For Input As #1
While EOF(1) = 0
Input #1, s
List1.AddItem s
Wend
Close 1
D!m
-
Sep 1st, 2000, 01:18 AM
#4
Try this:
Code:
Public Sub List_Load(TheList As ListBox, FileName As String)
On Error Resume Next
Dim TheContents As String
Dim fFile As Integer
fFile = FreeFile
Open FileName For Input As fFile
Do
Line Input #fFile, TheContents$
Call TheList.Additem (TheContents$)
Loop Until EOF(fFile)
Close fFile
End Sub
Usage:
Call List_Load(List1, "C:\file.txt")
-
Sep 1st, 2000, 01:57 AM
#5
Thread Starter
Lively Member
Thanks. It worked. Acutally, I used "Matthew Gate"'s. Thanks anyways.
___________________________
Chris
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
|