delphi 方法中某些代码不执行

来源:百度知道 编辑:UC知道 时间:2024/06/23 23:34:08
function tform4.tianjiayanzheng():boolean;
var
i:integer;
begin
i := strtoint(edit2.Text);
if i < 1790 then
begin
i := strtoint(LeftStr(datetostr(date),4)) - i;
showmessage('大家快来瞻仰'+ inttostr(i)+'岁的老怪物啊');
edit2.Text := '';
result := false;
exit;
end;
if (edit1.Text = '') or (edit2.Text = '') or (edit3.Text = '') or (edit4.Text = '') then
begin
result := false;
exit;
end;
if CheckBox1.Checked then
begin
if yueshu.Text = '' then
begin
result := false;
exit;
end;
end;
if (ComboBox1.Text = '') or (ComboBox2.Text = '') or (ComboBox3.Text = '') or (ComboBox4.Text = '') or (ComboBox5.Text = '') or (ComboBox6.Text = '') then
begin
result

这个我看不出来..

至少我觉得是 i := strtoint(edit2.Text); 第一句应该加个try 判断,防止edit2.Text 为空或者输入非数字,抛的错误,

剩下的,,F5 断点, F8 单步跟踪吧,,特别是第一次,你仔细看看,看到底发生了什么奇怪的事情呢..找到什么东东记的hi我哦,,关注这个问题中....