mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 21:11:45 +02:00
40 lines
716 B
ObjectPascal
40 lines
716 B
ObjectPascal
{$ifdef fpc}{$mode objfpc}{$endif}
|
|
|
|
uses classes, sysutils;
|
|
|
|
var list : TStringList;
|
|
|
|
begin
|
|
list := TStringList.Create;
|
|
try
|
|
try
|
|
list.commatext := '"OK"';
|
|
writeln ('---');
|
|
writeln (list.text);
|
|
writeln ('---');
|
|
except
|
|
on e:exception do
|
|
begin
|
|
writeln('Exception: '+e.message);
|
|
halt(1);
|
|
end;
|
|
end;
|
|
try
|
|
//Failed
|
|
list.commatext := '';
|
|
writeln ('---');
|
|
writeln (list.text);
|
|
writeln ('---');
|
|
except
|
|
on e:exception do
|
|
begin
|
|
writeln('Exception: '+e.message);
|
|
halt(1);
|
|
end;
|
|
end;
|
|
finally
|
|
list.Free;
|
|
writeln ('Freeing list');
|
|
end;
|
|
end.
|