发布时间:2019-07-29 16:49:09
implementation
type
studentrecoed=record
xh,xm:string[10];
yw,sx,wy:integer;
procedure Tfrom1.Button3Click(Sender: TObject);
var
pos:integer;
t:studentrecoed;
f:file of studentrecoed;
begin
pos:=listbox1.ItemIndex;
assignfile(f,'d:\my documents\文件.dat');
reset(f);
seek(f,pos+1);
while not eof(f) do
begin
read(f,t);
seek(f,pos);
pos:=pos+1;
write(f,t);
seek(f,pos+1);
end;
seek(f,pos);
truncate(f);
seek(f,0);
listbox1.Items.Clear;
while not eof(f) do
begin
read(f,t);
listbox1.Items.Add(t.xh+' '+t.xm+' '+inttostr(t.yw)+' '+inttostr(t.wy)+' '+inttostr(t.sx));
end;
closefile(f);
end;