Show: Delphi C++
Display Preferences


From RAD Studio API Documentation
Jump to: navigation, search


procedure New(var X: Pointer);


Type Visibility Source Unit Parent
procedure public System.pas System System


Creates a new dynamic variable and sets P to point to it.

In Delphi code, the New procedure creates a new dynamic variable and sets a pointer variable to point to it. P is a variable of any pointer type. The size of the allocated memory block corresponds to the size of the type that P points to. The newly created variable can be referenced as P^. If there is not enough memory available to allocate the dynamic variable, an EOutOfMemory exception is raised.

When an application is finished using a dynamic variable created with New, it should dispose of the memory allocated for the variable using the Dispose standard procedure.

See Also

Code Examples

Personal tools
In Other Languages
Previous Versions