ts010008.pp 562 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. type
  2. tobject2 = class
  3. constructor create;
  4. function rname : string;
  5. procedure wname(const s : string);
  6. property name : string read rname write wname;
  7. end;
  8. tclass2 = class of tobject2;
  9. var
  10. o2 : tobject2;
  11. c2 : tclass2;
  12. constructor tobject2.create;
  13. begin
  14. inherited create;
  15. end;
  16. procedure tobject2.wname(const s : string);
  17. begin
  18. end;
  19. function tobject2.rname : string;
  20. begin
  21. end;
  22. begin
  23. o2:=tobject2.create;
  24. o2.name:='1234';
  25. writeln(o2.name);
  26. o2.destroy;
  27. o2:=c2.create;
  28. c2.destroy;
  29. end.