mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-11 14:48:47 +02:00
19 lines
289 B
ObjectPascal
19 lines
289 B
ObjectPascal
{$mode objfpc} {$h+}
|
|
var
|
|
i: longint;
|
|
|
|
function CreateString: pString;
|
|
begin
|
|
if i<>0 then
|
|
halt(1);
|
|
inc(i);
|
|
writeln('Creating a string');
|
|
new(result);
|
|
end;
|
|
|
|
begin
|
|
dispose(CreateString); // prints “Creating a string” twice
|
|
if i<>1 then
|
|
halt(2);
|
|
end.
|