unit fjf217w;

interface

type
  pm = ^m;
  m = object
    Next : pm;
    constructor Init;
    procedure foo; virtual;
    destructor Done; virtual;
  end;
  
  be = object (m) end;

  pbe = ^be;

implementation

constructor m.Init;
begin
end;

procedure m.foo;
begin
end;

destructor m.Done;
begin
end;

end.

unit fjf217x;

interface

uses fjf217w;

type
  TC = object
    Messages : pm;
    procedure RaiseMessage (Message : pm);
  end;

implementation

procedure TC.RaiseMessage (Message : pm);
begin
  Message^.Next := Messages;
  Messages := Message
end;

end.

unit fjf217v;

interface

uses fjf217w;

type
  e = object (be)
    fa, fb : Integer;
    constructor Init (a, b : Integer);
    procedure foo; virtual;
  end;

  pe = ^e;

implementation

constructor e.Init (a, b : Integer);
begin
  fa := a;
  fb := b;
end;

procedure e.foo;
begin
  writeln (chr (fa), chr (fb))
end;

end.

unit fjf217u;

interface

uses fjf217w, fjf217x, fjf217v;

type
  o = object (tc)
    constructor i;
    procedure p (a, b : Integer);
  end;

implementation

constructor o.i;
begin
end;

procedure o.p (a, b : Integer);
begin
  RaiseMessage (New (pe, Init (a, b)))
end;

end.

program fjf217;

uses fjf217u;

var vo:o;

begin
  vo.i;
  vo.p (ord('O'), ord('K'));
  vo.messages^.foo
end.
