File Reading Problem

BlitzMax Forums/BlitzMax Beginners Area/File Reading Problem

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 have a file full of map data stored as bytes. I am trying to read it into a pre-defined array using this code:

	file=OpenStream("level1.dat") 
	If Not file RuntimeError "failed to open level1.dat file"
	databyte=0
	For x=0 To 170
		For y=0 To 12
			MapData[databyte]=ReadByte file
			databyte:+1
		Next
	Next
	
	CloseStream file


but get the following error:

"Compile Error
Unable to convert from 'Int(Tstream)' to 'Int'

Please help before I chuck the computer into the river..