var BiaoZhi:integer;
begin
BiaoZhi:=0;
if Bh_edit.Text='' then
if application.messagebox('官兵的编号不能为空!','提示信息',mb_ok+mb_defbutton1)<>idok then
Begin
Bh_edit.SetFocus;
BizoZhi:=1;
end;
if BiaoZhi=1 then begin exit; end;
//这样不就很好,最好不要用goto,加个状态量即可
begin
BiaoZhi:=0;
if Bh_edit.Text='' then
if application.messagebox('官兵的编号不能为空!','提示信息',mb_ok+mb_defbutton1)<>idok then
Begin
Bh_edit.SetFocus;
BizoZhi:=1;
end;
if BiaoZhi=1 then begin exit; end;
//这样不就很好,最好不要用goto,加个状态量即可
begin
if Bh_edit.Text='' then
if application.messagebox('官兵的编号不能为空!','提示信息',mb_ok+mb_defbutton1)<>idok then
Begin
Bh_edit.SetFocus;
exit;
end;
或者你试试abort
begin
if Bh_edit.Text='' then
begin
showmessage('官兵的编号不能为空!');
Bh_edit.SetFocus;
exit;
end;
end;
The Exit procedure immediately passes control away from the current procedure. If the current procedure is the main program, Exit causes the program to terminate.
把<>改成 = 就行了。