Mirage Source
Loading external txt file - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Loading external txt file (/showthread.php?tid=741)



Loading external txt file - Anthony - 15-02-2007

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?


- Misunderstood - 15-02-2007

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.


- Obsidian - 15-02-2007

it's just "loop"

do while
whatever
loop