Hello,
Today I compiled my FPC from trunk and saw the following possibility:
{ TIntegerHelper }
TIntegerHelper = record helper for Integer
function ToString: string;
end;...
{ TIntegerHelper }
function TIntegerHelper.ToString: string;
begin
Result := IntToStr(Self);
end;...
var
I: Integer = 123;
begin
WriteLn(I.ToString); // Prints 123
end.Or:
{ TStringHelper }
TStringHelper = record helper for String
function ToUpperCase: string;
end;...
uses
LazUTF8;{ TStringHelper }
function TStringHelper.ToUpperCase: string;
begin
Result := LazUTF8.UTF8UpperCase(Self);
end;
...
var
S: UTF8String = 'aten??o';
begin
WriteLn(S.ToUpperCase); // Prints ATEN??O
// or
WriteLn('aten??o'.ToUpperCase); // Prints ATEN??O
end.It's evolution, baby! =)
Thanks alot for this great implementation, FPC team! (and special thanks to Sven!) =D
