tw39514.pp 280 B

1234567891011121314151617181920
  1. { %fail }
  2. {$mode objfpc} {$longstrings on}
  3. procedure ThrowException; noreturn;
  4. begin
  5. raise TObject.Create;
  6. end;
  7. procedure DoSomethingWithString;
  8. begin
  9. writeln(Copy('hey', 1, 2));
  10. ThrowException;
  11. end;
  12. begin
  13. try
  14. DoSomethingWithString;
  15. except
  16. writeln('catch');
  17. end;
  18. end.