read file,load file help

BlitzMax Forums/BlitzMax Beginners Area/read file,load file help

I have a global list:tlist=createlist() in my tscore type.
To read a file of highscores,I use this right before my main.
''''''''''''''load highscores'''''''''
If FileType("highscores.dat") = 0 Then 
Local new_file = CreateFile("highscores.dat")
End If
Local Read_file = ReadFile("highscores.dat")

While Not Eof(Read_file)
For Local x:tscore=EachIn tscore.list
x.name=ReadLine(Read_file)
x.score=Readint(read_file)
x.level=Readint(read_file)
Next
Wend

CloseStream(Read_file)

At the end of the game,I save the file this.
'''''''''''''''save highscores'''''''''
Local write_file = WriteFile("highscores.dat")
For Local x:tscore=EachIn tscore.list
WriteLine(write_file,x.name)
WriteInt(write_file,x.score)
WriteInt(write_file,x.level)
Next
CloseStream(write_file)

Did alright the first time it ran,froze after that.Could someone point me in the right direction.

Thanks,
mudcat