[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 NEW                   Allocate New Heap Space Variable               pp 120

 Syntax:  New (PtrVar) ;

 Type:    Pointer

 Form:    Procedure

 Purpose: Create a new dynamic variable in heap space.

 Notes:   New variables of any type are allocated with a call to NEW.
          The type is determined by the type of the variable pointer.
          Assignments between pointer variables can be made as long as
          both are of the same type.  Relational operators may also be
          applied to like typed pointers.

          Each call to NEW allocates memory at the Heap pointer.  The Heap
          pointer is then moved upwards in memory by the amount of space
          just allocated.

 Usage:
       VAR
          PtrVar : ^Integer ;  { Declare pointer to integer type }

       BEGIN
          New (PtrVar)       ;  { Allocate 2 bytes on heap        }
       END.

See Also: GetMem Heap MaxAvail MemAvail Pointer
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson