[fpc-pascal]Re: Behavior of system.New procedure
pascalive at bol.com.br
Sat Jul 3 19:25:33 CEST 2004
Jeff Pohlmeyer wrote:
>>>After allocating a new instance for Arec with New proc,
>>>the record fields (APointer and Aint) will be always
>>>zero filled or will receive random values?
>>You must do as if it contains the most unexpected data,
>>and therefore initialise the fields *yourself*, and the
>>safer is to do it the quicker.
> As a shortcut to initialize all fields to zero (or nil)
> you can just do this:
> FillChar(ARec^, SizeOf(TRec), #0);
Thanks for the responses.
More information about the fpc-pascal