WriteLine

Blitz3D Forums/Blitz3D Programming/WriteLine

Nack(Posted 2007) [#1]
I see that writeline automatically include a "end-of-line" mark. It automatically go to the next line, is there anyway to NOT go to the next line? I am trying to overwrite a line in the middle of a file, but it keep making an extra line. Or is there anyway to Deleteline? Hope i make sense.


GfK(Posted 2007) [#2]
WriteString()?


Nack(Posted 2007) [#3]
The file I am writing to is a plain text file. (Script files)...to mine understanding, I believe writestring cant write plain text file.
nack


Floyd(Posted 2007) [#4]
You can't do anything to the middle of a file except change existing bytes. So the new line must be exactly the same length as the old one. When WriteLine writes an EOL it would simply overwrite the old one. So there should be no problem in this case.

If the new text line is not the same length as the old one then this approach can't work. You just have to make a new file.

Depending on what you need it might be easiest to settle on a fixed maximum line length in advance. If you knew that 50 characters would always suffice you could make all lines have length 50, padding with spaces at the end when necessary. Then you can change them at will. Of course this might waste a thousandth of a penny's worth of disk space.