File writing

BlitzMax Forums/BlitzMax Beginners Area/File writing

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I simply just want to write a load of strings to a file and then read them back.

That's how I've always done my data files; I value easy human editability over compactness. :)

I just tested this, and the exact same approach I used in B3D works just fine in BlitzMax:
OutFile = WriteFile( "MyTest.txt" )
WriteLine OutFile, "Test string 1."
WriteLine OutFile, "And another one."
CloseFile OutFile

InFile = ReadFile( "MyTest.txt" )
While Not Eof( InFile )
	a$ = ReadLine( InFile )
	Print a$
Wend
Or are you needing something more advanced?