Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loading external txt file
#1
So, I am trying to load an external txt file into a text box. Right now I have this code:
Code:
Dim iFileNum As Integer
Dim Data As String

iFileNum = FreeFile

Open App.Path & "\Data\notes.txt" For Input As #iFileNum

    Input #iFileNum, Data
        txtNotes.Text = Data + vbNewLine
Close #iFileNum

It works except it only loads whats on the first line of the txt file and won't load whats on lines 1, 2, 3, ect. Anybody know how to load the other lines as well?
Reply
#2
do while not eof(iFileNum)
line input #iFileNum, Data
txtNotes.text=txtNotes.text+Data+vbNewLine
end while(or is it end loop?, I don't remember)

^that instead of your input part.
Reply
#3
it's just "loop"

do while
whatever
loop
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)