Filesize Function with Win95 & BP7

Hi,
can someone help me, I have a problem using windows 95 as a network, and
BP7.00. When trying to run the program attached (testsize.pas) the server
machine correctly records the file size, but as soon as the program is run
from then the work station, it reports file size correctly, but then adds
the record at the wrong place. When the server has records added it
increments from the work stations record size, and after the server as
added, lets say 5 records, and the work station begins to add new records,
the work station filesize carrys on where it left off the last time it added
record, as if its not getting the physical filesize on the server.
kind regards
michae reyneke
sky...@iqsoftware.co.za

{$A+,B-,D+,E+,F-,G-,I+,L+,N-,O-,P-,Q-,R-,S+,T-,V-,X+,Y+}
{$M 60000,0,655360}
pROGRAM TESTSIZE;
uSES wincrt,windos;
TYPE
  StMFRec = RECORD
    stmf_Code                     : String[15];
    stmf_Description              : String[30];
    stmf_SupplierCode             : String[15];
    stmf_Single_Serial            : String[20];
  end;
  VAR
  STDAT : fILE OF STMFREC;
  STWORK : STMFREC;
  CH : cHAR;
  STX,
  XXX : lONGINT;
LABEL RESTART;
  BEGIN
  FILEMODE:=66;
  ASSIGN(STDAT,'stk.ST1');
  {$I-}
  RESET(STDAT);
  {$I+}
  IF IORESULT<>0 THEN REwrite(STDAT);
RESTART:
     WRITELN('PRESS ENTER TO ADD A STOCK RECORD');
     ch:=readkey;
     IF CH=#27 THEN
     BEGIN
     CLOSE(STDAT);
     HALT;
     END;
     FILLCHAR(STWORK,SIZEOF(STWORK),0);
     XXX:=filesize(STDAT);
     WRITELN('tHERE WERE ',xxx,' RECORDS');
     XXX:=filesize(STDAT)+1;
     SEEK(STDAT,XXX-1);
     WRITE(STDAT,STWORK);
     XXX:=filesize(STDAT);
     WRITELN('NOW THERE ARE ',XXX,' RECORDS');
     WRITELN('pRESS A KEY TO UNLOCK FILE');
GOTO RESTART;
end.