菜
菜鸟阿胡
Unregistered / Unconfirmed
GUEST, unregistred user!
[?]
代码如下:
procedure loadmulu;
var i,j:integer;
begin
if fileexists('mulu.dat') then
begin
reset(mulufile);
while not eof(mulufile) do
begin
read(mulufile,mulu0);
form1.ComboBox1.Items.Add(mulu0.name);
end;
seek(mulufile,0);
read(mulufile,mulu0);
form1.ListBox1.Items.Add(mulu0.name);
end else
rewrite(mulufile);
closefile(mulufile);
end;
procedure TForm2.btaddokClick(Sender: TObject);
var i0,j0:integer;
change:boolean;
temp:string;
begin
if combobox1.ItemIndex=-1 then
begin
seeker:=-1;
reset(mulufile);
repeat
inc(seeker);
seek(mulufile,seeker);
until eof(mulufile);
temp:=combobox1.Text;
mulu0.name:=temp;
mulu0.items.Clear;
mulu0.items.Add(edit1.Text);
write(mulufile,mulu0);
loadmulu;
temp:='dai'+inttostr(filesize(mulufile))+'.dat';
closefile(mulufile);
assignfile(daifile,temp);
rewrite(daifile);
dai0.name:=edit1.Text;
dai0.items:=memo1.Lines;
write(daifile);
closefile(daifile);
loadmulu;
end;
代码出错信息如下:
projct project1.exe raised exception class eaccessviolatio
with message 'access violation at address 004656c3 in module'
project1.exe'.read of address 00000000'.process stopped.
ues step or run to continue.
代码如下:
procedure loadmulu;
var i,j:integer;
begin
if fileexists('mulu.dat') then
begin
reset(mulufile);
while not eof(mulufile) do
begin
read(mulufile,mulu0);
form1.ComboBox1.Items.Add(mulu0.name);
end;
seek(mulufile,0);
read(mulufile,mulu0);
form1.ListBox1.Items.Add(mulu0.name);
end else
rewrite(mulufile);
closefile(mulufile);
end;
procedure TForm2.btaddokClick(Sender: TObject);
var i0,j0:integer;
change:boolean;
temp:string;
begin
if combobox1.ItemIndex=-1 then
begin
seeker:=-1;
reset(mulufile);
repeat
inc(seeker);
seek(mulufile,seeker);
until eof(mulufile);
temp:=combobox1.Text;
mulu0.name:=temp;
mulu0.items.Clear;
mulu0.items.Add(edit1.Text);
write(mulufile,mulu0);
loadmulu;
temp:='dai'+inttostr(filesize(mulufile))+'.dat';
closefile(mulufile);
assignfile(daifile,temp);
rewrite(daifile);
dai0.name:=edit1.Text;
dai0.items:=memo1.Lines;
write(daifile);
closefile(daifile);
loadmulu;
end;
代码出错信息如下:
projct project1.exe raised exception class eaccessviolatio
with message 'access violation at address 004656c3 in module'
project1.exe'.read of address 00000000'.process stopped.
ues step or run to continue.