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
If you are wanting to read a whole line (up to the next cr/lf pair), ammend your code to:
Line Input #iFileNumber, sLine
Input by itself is used to read comma seperated values in the order they were written:
Print #iFileNumber, 1, “A test”
Input #iFileNumber, iMyInt, sMyString
Hope this helps
Of course!