[fpc-pascal]Behavior of system.New procedure

Luiz Américo pascalive at bol.com.br
Fri Jul 2 02:53:42 CEST 2004


If someone can help me with this...
Take the following example:

type
TRec = record
   Apointer:Pointer;
   AInt:Integer;
end;
PRec = ^TRec;

var
   Arec:PRec;
   Return:Boolean;

begin
   New(ARec);
   Return:=ARec^.APointer = nil; (Always True ?)
   Return:=ARec^.Aint = 0; (Always True ?)
end.


My question is:
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?

Thanks in advance

Luiz






More information about the fpc-pascal mailing list