Program Test;

Uses {$ifdef Windows}wincrt,{$endif}MyObj in 'chief6.pas';

Type

pNewObj = ^TNewObj;
TNewObj = Object (TObject)
   Constructor Create (aOwner:pObject);
end; { TNewObj }

Constructor TNewObj.Create;
Begin
  Inherited Create (aOwner);
  Name   := 'Object Child';
  Handle := 2000;
End;  { TNewObj.Create }


{ Program() }
Var
ThisObj : TObject;

Begin
{
  Writeln ('Hello World. Program Begins Here!');
  Writeln ('---------------------------------');
}
  ThisObj.Init;
  With ThisObj do begin
     Name    := 'Object Number 1';
     Name    := 'OK';
     Handle  := 1000;
     Child   := New (pNewObj, Create (@ThisObj) );
{
     Writeln ('My SelfID    = ', SelfID);
     Writeln ('My Handle    = ', Handle);
     Writeln ('My name      = ', Name);
     Writeln ('Child SelfID = ', Child^.SelfID);
     Writeln ('Child Handle = ', Child^.Handle);
     Writeln ('Child name   = ', Child^.Name);
     Writeln ('Child PARENT SelfID = ', Child^.Parent^.SelfID);
     Writeln ('Child PARENT Handle = ', Child^.Parent^.Handle);
}
     writeln ( Child^.Parent^.Name );
     Child^.Free;
     Done;
  end; { With ThisObj }
{
  Writeln ('---------------------------------');
  Writeln ('Hello World. Program Ends Here!!');
}
  {$ifdef Windows}ReadKey;DoneWinCrt{$endif}
End. { Program() }
