NEW

Top  Previous  Next

Syntax

POINTER = NEW(type, size as INT)

Description

Creates a dynamic variable in memory.

Parameters

type - Any built in type such as INT, STRING, etc. or  a UDT name.

size - If greater than one will create a single dimensional array of the specified type.

Return value

A pointer to the newly created variable

Remarks

The pointer returned can not be an autodefined one. You must define the pointer first.

See Also: DELETE, Using Pointers

Example usage

DEF pInt as POINTER
pInt = NEW(INT,10)
#<INT>pInt[0] = 7
#<INT>pInt[5] = 8
DELETE pInt