Highscores help!

Blitz3D Forums/Blitz3D Programming/Highscores help!

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.

ok i rewrote the code EDIT: now that my code is readable can someone please tell me why it doesn't work.

Function record(points1,points2,t_secs#,t_mins,num_of_players)
	settings_file = OpenFile("settings.data")
		If num_of_players = 1 Then
			If points1 > points2 Then
				ReadLine(settings_file)
				ReadLine(settings_file)
				ReadLine(settings_file)
				ReadLine(settings_file)

				ReadLine(settings_file);name
				hiscore_t_mins=ReadLine(settings_file);mins
				hiscore_t_secs#=ReadLine(settings_file);secs
				ReadLine(settings_file);level
					If Not t_mins = hiscore_t_mins Then
					If t_mins > hiscore_t_mins Or t_secs# > hiscore_t_secs# Then
						SeekFile(settings_file,0)
					ReadLine(settings_file)
					ReadLine(settings_file)
					ReadLine(settings_file)
					ReadLine(settings_file)
					Print "congrats you made the high scores enter your name! "
						name$=Input$("")
							Trim$(name$)
					Print"writing data..."
						WriteLine(settings_file,name$)
						WriteLine(settings_file,t_mins)
						WriteLine(settings_file,t_secs#)
						WriteLine(settings_file,level)
					Print"data written!"

				EndIf
			EndIf
		EndIf
	EndIf
CloseFile(settings_file)
End Function