Previous: 2.2.13.9. Fail procedure To the Table of Contents Next: 2.2.13.11. Desctructors
2.2.13.9. Fail procedure Table of Contents 2.2.13.11. Desctructors

- 2.2.13.10. -
Table of Contents
2. TMT Pascal Language Description
2.2. Pascal Language Structure
2.2.13. OOP Extensions
2.2.13.10. Using New Procedure (OOP)


2.2.13.10. 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: 2.2.13.9. Fail procedure To the Table of Contents Next: 2.2.13.11. Desctructors
2.2.13.9. Fail procedure Table of Contents 2.2.13.11. Desctructors

- 2.2.13.10. -