[fpc-pascal] how to use Default to replace this " FillChar(aRecord, sizeof(aRecord), 0);

Sven Barth pascaldragon at googlemail.com
Mon Dec 5 11:32:42 CET 2016


Am 05.12.2016 08:24 schrieb "Dennis" <dec12 at avidsoft.com.hk>:
>
> In this old statement, I don't need to know the type of aRecord
> but if I want to use Default, I have to know the exact type of the
varaible aRecord and pass it to Default(aRecordType) e.g. aRecord :=
Default(aRecordType)  //where var  aRecord : aRecordType
>
> Is it possible to use default without knowing the variable type? (it is
because sometimes the type get renamed)

No, it's not possible. You'll simply have to rename one more location.

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


More information about the fpc-pascal mailing list