2
0

tbs0305.pp 515 B

12345678910111213141516171819202122232425262728
  1. {$mode objfpc}
  2. uses
  3. (* sysutils does not work correctly with DPMIEXCP unit
  4. anyway, its not needed anymore
  5. since the exception handler is now in system unit
  6. {$ifdef go32v2}
  7. dpmiexcp,
  8. {$endif} *)
  9. sysutils;
  10. var i,j,k:real;
  11. const except_called : boolean = false;
  12. begin
  13. i:=100;
  14. j:=0;
  15. try
  16. k:=i/j;
  17. writeln(k:5:3);
  18. except
  19. k:=0;
  20. writeln('Illegal Input');
  21. except_called:=true;
  22. end;
  23. if not except_called then
  24. begin
  25. Writeln('Error in except handling');
  26. Halt(1);
  27. end;
  28. end.