Read Text From a File Quickly

Category:
String Manipulation
Type:
Snippets
Difficulty:
Intermediate
Author:
Brian matumbura

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
The function returns text from a file whose name you specify as an argument. This is extremely fast, especially if you are dealing with large text files. Compare this with the usual

While NOT EOF(i)

...

Wend

loop when reading large files ~500MB and you will see a difference in speed of execution.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: