I wonder if the fileEOF command only returns 1 if the file is past the end of the file.
Like...
While fileEOF(1)=0
Read etc
Endwhile
Is running an extra loop, because once you've read the 9 values the file still hasn't passed it's end point - it'll do that the next time it tries to read from it, so when it comes around to check the While condition, it's still false, so goes through the whole thing again.
But if you your a Repeat...Until - the check would be done at the end, it might still have the same problem of course - just pointing out the main difference between the loop types.
The way around it, is to just not do it that way
Like, the code makes a lot of assumptions that get it in trouble when it can't detect the end of the file. I would suggest having control values so you know what exactly is coming next in a file. You might save an extra integer that holds a code for example. Code 1 might be zone, x, y, trigger etc etc - and when you read a 1, you know to read the rest of the values - but have it only read the data that it expects to find... if it finds a null byte at the end of the file, then it wouldn't bother trying to read any more.
Might be an idea, you could save all sorts of different data in different files, have a level file able to designate an items properties, or an enemy character. I tend to work like this but with more abstraction, like a script file doing the job of a level file. It ends up a little bloated, but opens up a whole load of possibilities. Like, in EDS there are character scripts for each character, specifying the stats, starting inventory etc...but it also allows the colouring of specific items, including the colour of the default hands item - so we get skin colouring for free
Just spit-balling.
I am the one who knocks...