Курсовая работа: Пасьянс "Три пика"
buf: TUserInfo;
begin
i := 0;
assign(f,'peaks.dat');
{$I-}
FileMode := 2;
reset(f);
{$I+}
if IOResult<>0 then
begin
rewrite(f);
write(f,UInfo);
close(f);
exit;
end;
repeat
read(f,buf);
inc(i);
until (i=filesize(f)) or (UInfo.UserName=buf.UserName);
if (UInfo.UserName=buf.UserName) then {Еслипользовательужеесть}
begin
buf.wcnt := buf.wcnt + UInfo.wcnt;
buf.dcnt := buf.dcnt + UInfo.dcnt;
buf.allscore := buf.allscore + UInfo.allscore;
seek(f,filepos(f)-1);
write(f,buf);
close(f);
exit;
end;