为何abort不起作用?
明明是false但窗口 DmmForm 还是显示出来了?
有没办法改进?谢了.....
procedure TMainForm.N38Click(Sender: TObject);
begin
CheckLeave(2);//调用下方函数
DmmForm.Show;
end;
//检查权限
procedure CheckLeave(I:Integer);
begin if trim(pub.LoginUserBorrow)='false' then
begin
ShowMessage('您没有浏览权限.');
exit;
abort;
end;
end;
明明是false但窗口 DmmForm 还是显示出来了?
有没办法改进?谢了.....
procedure TMainForm.N38Click(Sender: TObject);
begin
CheckLeave(2);//调用下方函数
DmmForm.Show;
end;
//检查权限
procedure CheckLeave(I:Integer);
begin if trim(pub.LoginUserBorrow)='false' then
begin
ShowMessage('您没有浏览权限.');
exit;
abort;
end;
end;
解决方案 »
- 找有实力的工作室或公司承接一软件开发项目
- 如何修改odbc配置->系统dsn->sql server->客户端配置->网络库选项(tpc/ip、namedpieps等)中的默认选项?
- 请教在Delphi中如何实现批量打印信封?(注意不能够重复打印)
- 如何在DBGird点选ROW时在TEXT1,2里显示其对应的数值(谢谢)
- 关于在用dpexpress控件向oracle数据库插入图片
- 客户机索引的问题!·!!
- installshield 如何打包!
- 报表问题。实现把数据逐行累计放于后面一个字段。怎么实现。懂的朋友快来啊!!
- 怎样同时新增主从两张表的数据?
- dbcombobox与dbgrid的字段绑在一起?我该怎么办?
- 两个不同的窗体,代码一样也会出错,想不通:List index out of bounds(0)
- 請教一個關於DBEdit或DBEditEh的問題
你可以把CheckLeave变成一个function,返回值是Boolean型,没有权限就返回false。
调用处可以
if CheckLeave(I: Integer) then
DmmForm.Show;
知道了..先ABORT;
再EXIT;
明白点说就是:即使有异常,也忽略异常继续执行后面的任务,且不显示异常信息给最终用户!DescriptionUse Abort to escape from an execution path without reporting an error.Abort raises a special "silent exception" (EAbort), which operates like any other exception, but does not display an error message to the end user. Abort redirects execution to the end of the last exception block.