File Help

Blitz3D Forums/Blitz3D Programming/File Help

Hey Guys, I'm trying to make a highscores table and the specific thing I'm trying to do is only display the greatest high score,level...etc. Here is my code. Could you please tell me what I'm doing wrong?


Function ModifyFile()

	f = OpenFile("maingamedata.dat")

	l = ReadInt(f)
	h = ReadInt(f)
	t = ReadInt(f)

	If l > 0
	
		WriteInt(f,leveln)
		
	EndIf
	
	If h > 0
	
		WriteInt(f,score)
		
	EndIf
	
	If t > 0
	
	   WriteInt(f,time)
		
	EndIf
		
	CloseFile(f)

End Function



I have the variables declared too. For some reason, whenever I wrap: WriteInt(), or any other Write function...It won't write. Does OpenFile() only open the file for write opperations, like ReadFile() prepares it for reading???

OpenFile returns if the file was successfully opened or not (Exists).

Oh sorry I forgot to update the post, I came up with a new solution.....thankyouforyourhelp:):):):):):):):)