texception11.pp 412 B

12345678910111213141516171819202122232425
  1. program texception11;
  2. {$mode objfpc}
  3. uses
  4. SysUtils;
  5. type
  6. ETest = class(Exception);
  7. procedure TestExcept(Obj : TObject; Addr : CodePointer; FrameCount:Longint; Frame: PCodePointer);
  8. begin
  9. if not (Obj is ETest) then
  10. Halt(1);
  11. if not (ExceptObject is ETest) then
  12. Halt(2);
  13. { explicitely halt with exit code 0 }
  14. Halt(0);
  15. end;
  16. begin
  17. ExceptProc := @TestExcept;
  18. raise ETest.Create('');
  19. end.