ts010007.pp 723 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. { $OPT=-S2 }
  2. { classes need objpas !! }
  3. { needed to intercept GPF (PM) }
  4. {$ifdef go32v2}
  5. uses dpmiexcp;
  6. {$endif go32v2}
  7. type
  8. tobject2 = class
  9. i : longint;
  10. procedure y;
  11. constructor create;
  12. class procedure x;
  13. class procedure v;virtual;
  14. end;
  15. procedure tobject2.y;
  16. begin
  17. Writeln('Procedure y called');
  18. end;
  19. class procedure tobject2.v;
  20. begin
  21. end;
  22. class procedure tobject2.x;
  23. begin
  24. v;
  25. end;
  26. constructor tobject2.create;
  27. begin
  28. end;
  29. type
  30. tclass2 = class of tobject2;
  31. var
  32. a : class of tobject2;
  33. object2 : tobject2;
  34. begin
  35. a:=tobject2;
  36. a.x;
  37. tobject2.x;
  38. object2:=tobject2.create;
  39. object2:=a.create;
  40. end.