home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / Chip_2000-02_cd.bin / zkuste / Delphi / navody / tt / objvm.exe / UNITS / FreeMember.pas < prev    next >
Pascal/Delphi Source File  |  1998-06-26  |  744b  |  28 lines

  1. unit FreeMember;
  2.  
  3. interface
  4. uses MemberValue,
  5.      LangValue;
  6. type
  7.         {TFreeMember realizes Free procedure for objects}
  8.      TFreeMember=class(TMemberValue)
  9.         procedure Exec(S:IValStack;MustReturn:boolean);override;
  10.      end;
  11. implementation
  12. uses VarLangValue,ObjectValue;
  13. procedure   TFreeMember.Exec;
  14.             Var a:ILangValue;
  15.             begin
  16.               S.DropFrame;
  17.               if MustReturn then
  18.               begin
  19.                 a:=TVarLangValue.Create(nil);
  20.                 a.AsBoolean:=true;
  21.                 s.Push(a);
  22.               end;
  23.               if Parent is TObjectValue then
  24.                 (Parent as TObjectValue).Target.Free;
  25.               Parent.Free;
  26.             end;
  27. end.
  28.