New (procedure)


 New (procedure)

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


 procedure New(var P: Pointer [ , Init: Constructor ]);


Windows, Real, Protected


The Declaration of New has been extended so it can also initialize an object allocated on the heap, if you pass it that object's constructor as a second parameter, like this:

 New(T, Init(360, 174));

New has also been extended to allow it to act as a function returning a pointer value.

The parameter passed to New is the type of the pointer to the object, rather than the pointer variable itself. This function form of New applies to all data types, not just object types. Like its procedure form, the function form of New can take the object type's constructor as a second parameter.

See Also

Sample Code

Тэги: New
| G+
Код для вставки: :: :: :: ::
Поделиться: // //