[fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

Sven Barth pascaldragon at googlemail.com
Sun Feb 5 20:29:34 CET 2017


Am 05.02.2017 15:04 schrieb "Ryan Joseph" <ryan at thealchemistguild.com>:
>
> I never knew Pascal had default parameters, a feature I always use and
enjoy in PHP. Once again I learn something new about the language I use. :)

I suggest you to read through the language reference guide then ;)

> However, the constructor with default params does not work. I get the
same error as before. {$modeswitch advancedrecords} is on.

Oh, well, it was worth a shot... Alternatively you could declare a class
function named Create that returns an instance of the record. Even Delphi
is using that for Rtti.TRttiContext.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170205/d42dee56/attachment.html>


More information about the fpc-pascal mailing list