Prolem Loading Data From File

BlitzMax Forums/BlitzMax Beginners Area/Prolem Loading Data From File

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.

Global line:string

Function LoadFile(path:string)
     Local file:Int
	
	file = ReadFile(path)

	While Not Eof(file)
		line:+ ReadLine(file)
	Wend
	
	CloseFile file
End Function


This will load a normal text file and fill the 'line' string variable with that file. Feel free to adapt it to your purpose. I think you only need to put brackets around you ReadLine statement to get it to work.

Hope it helps