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.
Printable View
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.
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
[email protected]
[email protected]
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
[email protected]
http://vbcode.webhostme.com/
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.