tb0264.pp 487 B

123456789101112131415161718192021222324252627282930313233343536
  1. { Old file: tbs0307.pp }
  2. { "with object_type" doesn't work correctly! OK 0.99.13 (?) }
  3. type
  4. tobj = object
  5. l: longint;
  6. constructor init;
  7. procedure setV(v: longint);
  8. destructor done;
  9. end;
  10. constructor tobj.init;
  11. begin
  12. l := 0;
  13. end;
  14. procedure tobj.setV(v: longint);
  15. begin
  16. l := v;
  17. end;
  18. destructor tobj.done;
  19. begin
  20. end;
  21. var t: tobj;
  22. begin
  23. t.init;
  24. with t do
  25. setV(5);
  26. writeln(t.l, ' (should be 5!)');
  27. if t.L<>5 then
  28. Halt(1);
  29. t.done;
  30. end.