Previous: Fail procedure To the Table of Content Next: Desctructors

- 2.2.13.10 -
TMT Pascal Language Description
Pascal Language Structure
OOP Extensions

Using New Procedure (OOP)

In most cases, instantiating of an object is combined with allocation of memory for the object:
var
  C: ^Circle;
begin
  New(C);
  C.Init(P, R);
  ...
The extended syntax of the New procedure allows one to combine the operation:
var
  C: ^Circle;
begin
  New(C.Init(P, R));
  ...
Note that constructors cannot be virtual methods, since virtual methods cannot be called before a constructor initializes the VMT.

See also:
New


Previous: Fail procedure To the Table of Content Next: Desctructors
Fail procedure Table of Content Desctructors

- 2.2.13.10 -