-
Dec 16th, 1999, 11:47 AM
#1
Thread Starter
Member
hi, i am tryin' to load a *BIG* text file into a listbox, i put the doevents so that the user won't think the program is freezing, but it's slow. Are there any better way? Thank in advance.
-
Dec 16th, 1999, 10:08 PM
#2
How are you bringing in the Text?
Are you using Line Input#/Input#?
Try opening the File for Bianry Access Read, then use the Get# Function to Grab Large chunks of the Data and Store the whole File in a String Variable.
This will reduce the amount of File Access and will be Faster when you have to Manipulate the Data when Breaking it down and putting it in the Listbox.
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net
-
Dec 16th, 1999, 10:09 PM
#3
Addicted Member
Maybe you don't need listbox?
Try the TextBox Control:
Private Sub Command1_Click()
Dim fnumber As Integer
Dim fname As String
Screen.MousePointer = vbHourglass
fnumber = FreeFile
fname = "d:\MyBigFile.txt"
Open fname For Input As #fnumber
Text1 = Input$(LOF(fnumber), fnumber)
Close #fnumber
Screen.MousePointer = vbDefault
End Sub
------------------
smalig
smalig@hotmail.com
http://vbcode.webhostme.com/
-
Dec 17th, 1999, 12:21 PM
#4
Thread Starter
Member
smalig, i am not tryin' to open a text file to a textbox like an editor, but thanks for respond anyway. Thanks aaron, i'll try that way.
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
|