tbs0261.pp 578 B

1234567891011121314151617181920212223242526272829303132
  1. program bug0261;
  2. { test for operator overloading }
  3. { Copyright (c) 1999 Lourens Veen }
  4. { why doesn't this work? }
  5. uses
  6. erroru,
  7. tbs0261a;
  8. var a : mythingy;
  9. b : myotherthingy;
  10. c : mythirdthingy;
  11. begin
  12. a.x:=55;
  13. a.y:=45;
  14. a.c:=7;
  15. b:=a;
  16. c:=a;
  17. if b.d<>c.e then
  18. begin
  19. Writeln('Error in assignment overloading');
  20. Halt(1);
  21. end;
  22. if b<>c then
  23. begin
  24. Writeln('Error in equal overloading');
  25. Halt(1);
  26. end;
  27. Writeln('Sizeof(mythirdthingy)=',sizeof(mythirdthingy));
  28. Writeln('Sizeof(mynewthingy)=',sizeof(mynewthingy));
  29. end.