mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 12:38:29 +02:00
21 lines
280 B
ObjectPascal
21 lines
280 B
ObjectPascal
{ %fail }
|
|
{$mode objfpc} {$longstrings on}
|
|
procedure ThrowException; noreturn;
|
|
begin
|
|
raise TObject.Create;
|
|
end;
|
|
|
|
procedure DoSomethingWithString;
|
|
begin
|
|
writeln(Copy('hey', 1, 2));
|
|
ThrowException;
|
|
end;
|
|
|
|
begin
|
|
try
|
|
DoSomethingWithString;
|
|
except
|
|
writeln('catch');
|
|
end;
|
|
end.
|