Hello everyone, I'm back again after a long time.

Had a 6 week vacation and I've been gone so much I haven't been online in that time.

Now I'm back working on this project again.
Glad to say the game itself is just about bug-free.

I've found 6 bugs now and I'm able to fix two of them.

The other 4 bugs are related (Same bug occurs in different parts of the game).

I've copied the game on a central network disk. This means everyone on this network plays the same game.
I've allowed 6 children to play this game simultaneously and starting the game didn't seem to be too much of a problem. Just encountered a slow-down because all 6 of them were loading the same images(BMP files) from a subdirectory in the game.
The real bug is file reading/writing:
There are some binary files (saved records) which store the important data (levels, highscore lists, accounts, etc....).
As they played the game it could suddenly begin to crash when they tried to read from those files or write to them (not certain about the writing though).

When creating this game I assumed that the time between opening and closing the file would be a fraction of a second. I thought this would make it nearly impossible to get any kind of bug there. Obviously I was mistaken.

The children tried it stand alone, so no delphi error, just a generic error with the "Send" and "Don't send" button (you know what I mean).


I've thought of a sollution myself, but I don't know this will work or how to implement it.
I'll show you a file read function first to explain:

Code:
function LoadFromVrgFile(filename:string):TMySaveRecord;
var myFile : File of TMySaveRecord;
    tv: TMySaveRecord;
begin
    AssignFile(myFile, filename);
    Reset(myFile);
    Read(myFile, tv);
    result := tv;
    CloseFile(MyFile);
end;
I thought of catching the read/write error, should it occur.
If it does, just try again (with a max of 20 times, should be enough).
If it goes wrong more than 20 times I'll assume the file itself is bad.

Is this the right way to go about things or not?
If so, is this the right way to implement this?

Code:
function LoadFromVrgFile(filename:string):TMySaveRecord;
var myFile : File of TMySaveRecord;
    tv: TMySaveRecord;
    i:integer;
begin
    AssignFile(myFile, filename);
    i := 0;
    Error := True;
    while &#40;i < 20&#41; AND &#40;Error&#41; do
    begin
      Error &#58;= False;
      Reset&#40;myFile&#41;;
      &#123;$I-&#125;
      Read&#40;myFile, tv&#41;;
      &#123;$I+&#125;
      If IOResult <> 0 then
      begin
        Error &#58;= True;
        inc&#40;i&#41;;
      end
      else
        result &#58;= tv;
      CloseFile&#40;MyFile&#41;;
    end;
end;
Made this code from the top of my head, would this work?