Reading text file only reading last line

For some reason im trying to read a text file with about 50 lines and it keeps only reading the last line???

    Dim sData As String
    Dim sinputline As String
    Dim ff As Integer
    ff = FreeFile
    sData = Empty

    Open sUpdateScriptSys For Input As #ff
        Seek #1, 1
        Do While Not EOF(ff)
            Line Input #ff, sinputline
            sData = sinputline
            DoEvents
        Loop
    Close #ff
thaburnerAsked:
Who is Participating?
 
fruhjConnect With a Mentor Commented:
simple
Sdata = sinputline
should be
SData = SData + sInputline
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
No, it's reading every line... you are just overwriting it each iteration of the loop.

What exactly are you trying to do - because the code you shown is just reading in the line and moving to the next line and not doing anything.
0
 
thaburnerAuthor Commented:
lol now i feel stupid i dont know what i was thinking. lol thx
0
 
fruhjCommented:
been there and done that so don't feel bad.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.