tb0611.pp 542 B

12345678910111213141516171819202122232425262728293031
  1. {$mode objfpc}
  2. {$warn 6018 off}
  3. type
  4. tmyclass = class
  5. procedure HelloMethod(i : longint);
  6. end;
  7. procedure Hello(i : longint);
  8. begin
  9. writeln({$I %CURRENTROUTINE%});
  10. if {$I %CURRENTROUTINE%}<>'Hello' then
  11. halt(i);
  12. end;
  13. procedure tmyclass.HelloMethod(i : longint);
  14. begin
  15. writeln({$I %CURRENTROUTINE%});
  16. if {$I %CURRENTROUTINE%}<>'HelloMethod' then
  17. halt(i);
  18. end;
  19. var
  20. myclass : tmyclass;
  21. begin
  22. Hello(1);
  23. myclass:=tmyclass.create;
  24. myclass.HelloMethod(1);
  25. myclass.Free;
  26. writeln('Ok');
  27. end.