W
Wizard00
Unregistered / Unconfirmed
GUEST, unregistred user!
我有这样一段程序,运行时死机,清高手指点迷津。谢谢!没多少分了,要破产了。
phnok:=false;
accok:=false;
testphn:=false; {假定没有}
testacc:=false;
while not phnok or not accok do
begin
repeat {查找是否 存在 新的电话号码和账号 }
if not testphn then
begin
tphone:=fieldbyname('电话号码').asstring;
if tphone=edit2.Text then testphn:=true {}
end;
if not testacc then
begin
taccount:=fieldbyname('账号').asstring;
if taccount=label8.Caption then testacc:=true
end;
if not (testphn and testacc) then next;
until eof or testacc and testphn;
if testphn then
begin
edit2.Text:=inttostr(strtoint(edit2.text)+1);
end else phnok:=true;
if testacc then
begin
label8.Caption:=inttostr(strtoint(label8.Caption)+1);
end else accok:=true;
end;
phnok:=false;
accok:=false;
testphn:=false; {假定没有}
testacc:=false;
while not phnok or not accok do
begin
repeat {查找是否 存在 新的电话号码和账号 }
if not testphn then
begin
tphone:=fieldbyname('电话号码').asstring;
if tphone=edit2.Text then testphn:=true {}
end;
if not testacc then
begin
taccount:=fieldbyname('账号').asstring;
if taccount=label8.Caption then testacc:=true
end;
if not (testphn and testacc) then next;
until eof or testacc and testphn;
if testphn then
begin
edit2.Text:=inttostr(strtoint(edit2.text)+1);
end else phnok:=true;
if testacc then
begin
label8.Caption:=inttostr(strtoint(label8.Caption)+1);
end else accok:=true;
end;