[fpc-pascal] Are record fields zeroed on declaration of a record?

Bo Berglund bo.berglund at gmail.com
Thu Oct 8 16:45:03 CEST 2020


On Thu, 8 Oct 2020 13:04:43 +0200 (CEST), Michael Van Canneyt via
fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:

>> OK,
>> is it possible to define the TMyRecord with default values so that
>> when I do Default(TMyRecord) it will be non-zero defaults written
>> instead of zeros?
>
>No. You will always need code for that.

OK,
I have now added code that sets those fields that should have non-zero
values to the default on startup. All others are handled by the
Default() call.
Works fine.
Thank you for your clarification!


-- 
Bo Berglund
Developer in Sweden



More information about the fpc-pascal mailing list