What is wrong on the following code.
To write to a file is no problem. All the data is written. But when i want to read this back in to the program i only get the first line in the rest stays empty.
Filein =ReadFile ("Data/TopScore.Dat") ;If file Not exist Then creat one. If Filein =0 FileOut=WriteFile("Data/TopScore.Dat") If fileout = 0 Then End; We expand this later For x = 1 To 10 TP_HighScore(x)\Name$ = "NOBODY" WriteString (FileOut,TP_HighScore(x)\Name$) TP_HighScore(x)\Score = 0 WriteString (FileOut,TP_HighScore(x)\Score) TP_HighScore(x)\date$ = CurrentDate$() WriteString (FileOut,TP_HighScore(x)\Date$) TP_HighScore(x)\Level = 0 WriteString (FileOut,TP_HighScore(x)\Level) Next CloseFile(FileOut) Filein =ReadFile ("Data/TopScore.Dat") EndIf For x = 1 To 10 TP_HighScore(x)\Name$ = ReadString$( filein ) TP_HighScore(x)\Score = ReadInt( filein ) TP_HighScore(x)\Date$ = ReadString$( filein ) TP_HighScore(x)\Level = ReadByte( filein ) Next CloseFile(filein)
To write to a file is no problem. All the data is written. But when i want to read this back in to the program i only get the first line in the rest stays empty.