Read a File Line by Line - and More.
Category:
Files and DirectoriesType:
SnippetsDifficulty:
BeginningAuthor:
AnonymousVersion Compatibility: Visual Basic 6
More information:
If you call this function while supplying just the file name, then every time you call it you get the next line of the file. You can supply a line number if you know which line you need. You can also reset the read cursor to the beginning of the file - all without making any changes to the code. Also an example of basic error handling.
Instructions: Copy the declarations and code below and paste directly into your VB project.
Declarations: