Delphi Try Except 实例
2021-02-08 14:17
标签:code 错误 cat har sage ica abort show nbsp Delphi Try Except 实例 标签:code 错误 cat har sage ica abort show nbsp 原文地址:https://www.cnblogs.com/jijm123/p/11351083.html//判断单位转换率
try
um_rate := vp_mstr.F(‘vp_um_rate_d‘).AsFloat / vp_mstr.F(‘vp_um_rate_m‘).AsFloat;
if um_rate 0 then
abort
else if (vp_mstr.F(‘vp_um‘).AsString = vp_mstr.F(‘part_um‘).AsString) and (um_rate 1) then
abort
else if (vp_mstr.F(‘vp_um‘).AsString vp_mstr.F(‘part_um‘).AsString) and (um_rate = 1) then
abort;
except on e:Exception do
begin
Application.MessageBox(PChar(E.Message), ‘error‘, 16);//抛出异常信息
priMsg.ShowMsg(‘004‘); //004=单位转换率设置错误!
edt_vp_um_rate_d.SetFocus;
abort;
end;
end;
文章标题:Delphi Try Except 实例
文章链接:http://soscw.com/index.php/essay/52678.html