How to output EOL/Carriage return to file?

Blitz3D Forums/Blitz3D Beginners Area/How to output EOL/Carriage return to file?

Shifty Geezer(Posted 2005) [#1]
Any way I can write a Carriage return to a file so that strings etc. can be on separate lines? That is to make this code
WriteString(file,"line 1")
WriteString(file,"line 2")


...output this...

line 1
line 2

...instead of this...

line 1 line 2


Ross C(Posted 2005) [#2]
Chr$(13) i believe should do that :o)

You could use the writeline() command. Each line it writes, it puts a return after it anyway.


Shifty Geezer(Posted 2005) [#3]
Thanks!


WolRon(Posted 2005) [#4]
In some instances, you may have to output Chr$(10) and Chr$(13).


TomToad(Posted 2005) [#5]
If I'm not mistaken, WriteString also outputs a string length before the string, so you might get something like:

7*bxLine 1
g~#PLine 2

in the .txt file, depending on the length of the string. Using WriteLine will avoid that as well as write a proper EOL.