tb0366.pp 467 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. {$ifdef fpc}{$mode objfpc}{$endif}
  2. uses
  3. ub0366;
  4. type
  5. tc2=class
  6. public
  7. FHeight : integer;
  8. procedure p1;
  9. end;
  10. procedure tc2.p1;
  11. var
  12. c1 : tc1;
  13. begin
  14. FHeight:=10;
  15. c1:=tc1.create;
  16. with c1 do
  17. begin
  18. Height:=FHeight;
  19. end;
  20. writeln('c1.Height: ',c1.Height,' (should be 10)');
  21. if c1.Height<>10 then
  22. begin
  23. writeln('ERROR!');
  24. halt(1);
  25. end;
  26. c1.free;
  27. end;
  28. var
  29. c2 : tc2;
  30. begin
  31. c2:=tc2.create;
  32. c2.p1;
  33. c2.free;
  34. end.