File Strings on one line as opposed to multiple?

Blitz3D Forums/Blitz3D Beginners Area/File Strings on one line as opposed to multiple?

Guy Fawkes(Posted 2011) [#1]
Hi all. How would I make the writeline format my text all on to one line as opposed to multiple lines?

Thank you! :)


Graythe(Posted 2011) [#2]
WriteString is, possibly, what you want. Put all of you text into a string and then use writestring to commit the data. It is worthwile knowing that the data may not be written until the file is closed.


Guy Fawkes(Posted 2011) [#3]
i need it to be pure text though


Graythe(Posted 2011) [#4]
Then use writebytes


_PJ_(Posted 2011) [#5]
I'm not sure why you would want it all pure text, since then there woudl; be no way to separate the individual strings (unless you knew in advance exactly how long wach would be)

For that reason, I would seriously recommend using the short-int length signifier of WriteString or a terminator of sorts.

However, for pure Ascii text ONLY, here:
Function WriteStringBytes(h_File%,s_String$)
	If (s_string="") Then Return
	Local n_IterChar
	For nIterChar=1 To Len(s_String)
		WriteByte h_file,Asc(Mid(s_string,nIterchar,1)) And 255
	Next
End Function	



Matty(Posted 2011) [#6]
You can use writeline, just pass it a single string...concatenate them into one string then write it.