Loading a Txt File into a Text Area?

BlitzPlus Forums/BlitzPlus Programming/Loading a Txt File into a Text Area?

Falelorn(Posted 2004) [#1]
How can you load a text file into a text area? Ive looked and cant find any info.

Thanks


soja(Posted 2004) [#2]
First use OpenFile. Then use a combination of ReadLine and AddTextAreaText. Then CloseFile.


Falelorn(Posted 2004) [#3]
Basically the program is more like a notepad editor.

Thanks soja, but could you or anyone provide a little more detail for me. Thanks.


Rimmsy(Posted 2004) [#4]
f=readfile("The file.txt")

while not eof(f)
r$=readline(f)
addTextAreaText(my_text_area,r)
wend

closefile f



Falelorn(Posted 2004) [#5]
thanks Rims. Ill try that


Rimmsy(Posted 2004) [#6]
oops, try try this if it comes out in one long line:

r$=readline(f)+chr(13) ; add a return