|
-
Jun 21st, 2000, 03:23 PM
#4
Hyperactive Member
I'm not sure if it would be faster, but you could alway avoid reading the lines, and simply use the split function. Here is what I mean:
Code:
Private Sub Command1_Click()
Dim fso, sTemp(1)
Dim newVar() As String
Dim myVar As String
Set fso = CreateObject("scripting.FilesystemObject")
Set sTemp(0) = fso.GetFile("c:\windows\desktop\testfile.txt")
Set sTemp(1) = sTemp(0).OpenAsTextStream(1, -2)
myVar = sTemp(1).ReadAll
newVar = Split(myVar, Chr(13) & Chr(10))
For x = 0 To UBound(newVar)
MsgBox newVar(x)
Next
End Sub
However, with 10,000 records, I'm not sure how much faster this would be, but at least you could avoid all the file accesses.
(Using VB6 SP3)
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
|