To build a record, a constructor is used. It is called when a record is first created.
A function can and should be called as needed.
You can create a “build” procedure, but you must name it yourself.
TVector = record private FImpl: IVector; public procedure Create; end; var vec : TVector; begin vec.Create;
An alternative is to create a factory function that returns an initialized record.
function CreateVector(): TVector; begin Result.Create; end;
source share