How read the text lines from txt file?
Posted: Wed Mar 12, 2014 3:22 pm
I have this little question but a big problem for me, How read text lines from txt file? I open the file and insert as items every text line?
The Cross-Platform Multimedia Application Layer
https://forums.hollywood-mal.com/
Code: Select all
OpenFile(1, "S:Startup-Sequence")
While Not Eof(1) Do NPrint(ReadLine(1))
CloseFile(1)Thanks although I want read every line and put inside of variable to use every line of text, and I don't know as to do this, read the end every line and put in one Text$ variable and read the end of txt file.PEB wrote:The Hollywood documentation has a lot of good example code, such as this:Code: Select all
OpenFile(1, "S:Startup-Sequence") While Not Eof(1) Do NPrint(ReadLine(1)) CloseFile(1)
Code: Select all
TempTable$={}
OpenFile(1, "S:Startup-Sequence")
While Not Eof(1) Do InsertItem(TempTable$, ReadLine(1))
CloseFile(1)Thanks, I need this, because I have problems with the translations for V.A.M.P. some special letters with editors and with the compiled change them, and the alternative is open the translation file, and get line to line and to put in the text message variable.PEB wrote:I might not be understanding what you want to do, but I think you want to put each line into a table. If that is the case, then you can modify the sample code to something like this:Code: Select all
TempTable$={} OpenFile(1, "S:Startup-Sequence") While Not Eof(1) Do InsertItem(TempTable$, ReadLine(1)) CloseFile(1)