New procedure
Dynamically allocate memory for variable.
Declaration
procedure &New(var P: Pointer)Description
New allocates a new instance of the type pointed to by
P, and
puts the address in
P.
If P is an object, then it is possible to
specify the name of the constructor with which the instance will be created.
The newly allocated memory is not initialized in any way, and may contain garbage data. It must be cleared with a call to FillChar or FillWord.
For an example, see Dispose.
Errors
What happens if no more memory is available,
depends on the value of the variable
ReturnNilIfGrowHeapfails:
if the variable is
True then
Nil is returned. If the
variable is
False, a run-time error is generated.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
