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> getmem allocate space on the heap pp 125</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 GETMEM                   Allocate Space on the Heap                  pp 125

 Syntax:  GetMem (PtrVar,ByteCnt) ;

 Type:    N/A

 Form:    Procedure

 Purpose: Allocate ByteCnt number of bytes in Heap space to PtrVar pointer.

 Notes:   GetMem will allocate space on the heap.  Unlike NEW, it will
          allocate the amount of space requested by the programmer.

          PtrVar is a pointer variable that will point to the allocated
          space, and ByteCnt is an integer variable holding the count.


 ----------------------------------------------------------------------------


 Usage:
       VAR
          ByteCnt : Integer        ;  { Bytes of memory to get     }
          PtrVar  :^Integer        ;  { Point to Integer data type }

       BEGIN
          GetMem (PtrVar, ByteCnt) ;  { Allocate the memory         }
       END.

See Also: FreeMem New Pointer Release

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