Alloc

See Also: Memory Management Functions, MemSet

Purpose

Allocates a block of memory.

Return Type

Pointer

Syntax

Alloc( {iBytesAllocated} )

Where:

What It Does

Alloc returns either a pointer to the allocated memory block, or zero (if the memory cannot be allocated). The memory is allocated on the process heap in DataFlex.

Example

Pointer aInfo

Char cByteNeeded

Integer iRetVal

 

Move (Alloc (cByteNeeded)) to aInfo

Move (MemSet (aInfo, 0, cByteNeeded)) to iRetVal

Notes