我的部分代码如下:
if CheckBoxdjrq.Checked and (trim(editdjrqstart.Text+' ')<>'') and TryStrToDate(editdjrqstart.Text,t)= false then
begin
showmessage('类型不一致,请输入日期型');
editdjrqstart.Clear;
editdjrqstart.SetFocus;
exit;
end;
if CheckBoxdjrq.Checked and (trim(editdjrqend.Text+' ')<>'') and TryStrToDate(editdjrqend.Text,t)= false then
begin
showmessage('类型不一致,请输入日期型');
editdjrqend.Clear;
editdjrqend.SetFocus;
exit;
end;但现在出现了一个非常奇怪的问题,情况如下:
我没有选 中该复选框,但是,他却执行了里面的操作,
请高手们赐教,到底是为什么?
if CheckBoxdjrq.Checked and (trim(editdjrqstart.Text+' ')<>'') and TryStrToDate(editdjrqstart.Text,t)= false then
begin
showmessage('类型不一致,请输入日期型');
editdjrqstart.Clear;
editdjrqstart.SetFocus;
exit;
end;
if CheckBoxdjrq.Checked and (trim(editdjrqend.Text+' ')<>'') and TryStrToDate(editdjrqend.Text,t)= false then
begin
showmessage('类型不一致,请输入日期型');
editdjrqend.Clear;
editdjrqend.SetFocus;
exit;
end;但现在出现了一个非常奇怪的问题,情况如下:
我没有选 中该复选框,但是,他却执行了里面的操作,
请高手们赐教,到底是为什么?
editdjrqend是一个文本框,用来输入日期的下限
if (CheckBoxdjrq.Checked) and (trim(editdjrqstart.Text+' ')<>'') and (TryStrToDate(editdjrqstart.Text,t)= false) thenif (CheckBoxdjrq.Checked) and (trim(editdjrqend.Text+' ')<>'') and (TryStrToDate(editdjrqend.Text,t)= false) then在pascal里,不时逻辑的优先级不是最低的。优先级问题。