Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> new allocate new heap space variable pp 120</b> http://www.X-Hacker.org [<<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

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson