Tools Links Login

Open a text file FAST!

Opens a text file much fast than a "Do While Not EOF(filenumber)" loop. Makes
file load times almost non-existant.

Original Author: Timothy Pew

Inputs

The filename of the file to open.

Assumptions

The filename that you pass to the function must exist, otherwise an error will occur.

Returns

The text contained in the file.

Side Effects

I have yet to run into any. If you do happen to find one leave a comment and
I will fix it.

Code

Public Function OpenFile(ByVal file As String) As String
Dim i As Integer
i = FreeFile
Open file For Input As #i
OpenFile = Input(LOF(i), i)
Close #i
End Function

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 104 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.