AllocateMemory()

Syntax

*MemoryID = AllocateMemory(Size)
Description
Allocates a contiguous memory area according to the specified size (in bytes). If the needed memory is available, the allocated memory will be initialized with 'Null' (0) and *MemoryID will get the start address of the memory area, else it will be 0.

Note: All the allocated memory areas are automatically freed when the programs ends.

Example:
  *MemoryID = AllocateMemory(5000)
  If *MemoryID
    Debug "Starting address of the 5000 Byte memory area:"
    Debug *MemoryID
    PokeS(*MemoryID, "Store this string in the memory area")
    FreeMemory(*MemoryID)  ; will also be done automatically at the end of program
  Else
    Debug "Couldn't allocate the requested memory!"
  EndIf

Supported OS

All

Memory Index - CompareMemory() ->