VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Open a text file FAST

by Timothy Pew (3 Submissions)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

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

Inputs
The filename of the file to open.
Assumes
The filename that you pass to the function must exist, otherwise an error will occur.
Code 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.

Rate Open a text file FAST

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

Download this snippet    Add to My Saved Code

Open a text file FAST Comments

No comments have been posted about Open a text file FAST. Why not be the first to post a comment about Open a text file FAST.

Post your comment

Subject:
Message:
0/1000 characters