Blitzmax vs Blitzplus filehandling.

BlitzMax Forums/BlitzMax Programming/Blitzmax vs Blitzplus filehandling.

Tiger(Posted 2011) [#1]
Hello, got some problems loading a old file saved with blitzplus.
How do blitzmax handle strings vs blitzplus?
I use 'Readline' command,and I don't get the right data from the file.


Tiger(Posted 2011) [#2]
ok, have a fix for it:
 Function RString:String(r:TStream)
	Local size:Int = r.ReadInt()
	Return r.ReadString(size)
 End Function



Czar Flavius(Posted 2011) [#3]
Readline grabs a line until it gets a new line character. It doesn't work well with binary ie non-plain text files. What is the format of the file?


Tiger(Posted 2011) [#4]
Well its a mix of string/int/bytes in the same file, a custom format.
Blitzplus and Blitzmax is using different setups when saving strings to a file, so thats why it didn't work without my 'converter' function(see my other post).
But maybe blitzmax already have that function build in to it? another command then 'Readline'?


Czar Flavius(Posted 2011) [#5]
What data does readline give you? A whole string or a string followed by other data? When writing the file, do you add any new line characters?