Reading files in Visual Basic, GW-Basic style

Recently I was asked how to read a file without using streams in Visual Basic. Of course, if you’ve done this once in GW-Basic, you never forget. Dim iFileNumber As Integer Dim sLine As String iFileNumber = FreeFile Open “C:\stats.log” For Input As iFileNumber Do While Not EOF(iFileNumber) Input #iFileNumber, sLine MsgBox sLine Loop