Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2014-02

Type/Record Helper SVN Change (Atn: FPC-Core Members)

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Den

Hi all to FPC Core,

I was wondering why the change to have a modeswitch for the Type/Record Helper? In Delphi there is no such switch needed. Doing something like:

--------------------------------------------------------

program TestHelper;
{$APPTYPE CONSOLE}
{$R *.res}
uses
   System.SysUtils;
type
   TStringHelper = record helper for String
     function Length: Integer;
   end;
var
   S: string;
begin
   S := 'Test String';
   Writeln(S, ', length: ', S.Length);
   ReadLn;
end.

--------------------------------------------------------

Should work out of the box (this example was taken straight from a Developer of XE3 btw).

- Dennis Fehr

Reply by email

Marco van de Voort
to Den

In our previous episode, Den said:

Should work out of the box (this example was taken straight from a Developer of XE3 btw).

IMHO it should be enabled at least in mode delphiunicode.

Reply by email