小编Vic*_*gin的帖子

可以从引发异常的点恢复执行吗?

有一个例子说明了我的问题:

procedure Test;
begin
  try
    ShowMessage('1');
    raise EWarning.Create(12345, 'Warning: something is happens!');
    ShowMessage('2');
  except
    on E: EWarning do
      if IWantToContinue(E.ErrorCode) then
        E.SkipThisWarning // shows '1' then '2'
      else
        E.StopExecution;  // shows '1'
  end;
end;

function IWantToContinue(const ErrorCode: Integer): Boolean;
begin
  //...
end;
Run Code Online (Sandbox Code Playgroud)

我试着用这样的东西:

asm
  jmp ExceptAddr
end;
Run Code Online (Sandbox Code Playgroud)

但它不会工作......

有任何想法吗?

谢谢.

delphi exception-handling exception

8
推荐指数
2
解决办法
3527
查看次数

标签 统计

delphi ×1

exception ×1

exception-handling ×1