- 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
- 2.2.13.10. -