How can this happen?
BlitzPlus Forums/BlitzPlus Beginners Area/How can this happen?
| ||
Is this a Bug in early Blitz version ;Initialise some variables For the example Type HighScore Field Name$ Field Score% Field Level% End Type Best.HighScore = New HighScore Best\Name = "Howard Colbourne" Best\Score = 50005 Best\Level = 34 ; Open a file to write to fileout = WriteFile("Dumbdata.dat") ; Write the information to the file WriteString( fileout, Best\Name ) WriteInt( fileout, Best\Score ) WriteByte( fileout, Best\Level ) ; Close the file CloseFile( fileout ) Best\Score = "" ;Open the file To Read filein = ReadFile("Dumbdata.dat") ; Lets read the Greatest score from the file Best\Name$ = ReadString$( filein ) Best\Score = ReadInt( filein ) Best\Level = ReadByte( filein ) Print "High score record read from - Dumbdata.dat " Write "Name = " Print Best\Name Write "Score = " Print Best\Score Write "Level = " Print Best\Level CloseFile( fileout )< It reads & writes correctly but when it hits this command it comes up[File does not exist] How can it say that after it just got thru reading the darn file? WaitKey() ? |
| ||
Hey, It is late and I took a glance at your code in line filein = ReadFile("Dumbdata.dat") You use the variable "filein" in line. CloseFile( fileout )< It reads & writes correctly but when it hits this command it comes up[File does not exist] How can it say that after it just got thru reading the darn file? you are trying to close the variable file called "fileout" which isn't open at the time. you need to use closefile (filein) :) Cheers |
| ||
DjBigWorm has hit the nail on the head! |
| ||
Thanks! I think my thumb was on the nail head! |