tw38766.pp 348 B

12345678910111213141516171819202122232425262728
  1. {$mode objfpc}
  2. type
  3. trec = record
  4. x, y: longint;
  5. end;
  6. function max(x,y: longint): longint;
  7. begin
  8. if x>y then
  9. result:=x
  10. else
  11. result:=y;
  12. end;
  13. function test: trec; inline;
  14. begin
  15. result.x:=1;
  16. result.y:=2;
  17. result.x:=max(result.x,result.y);
  18. end;
  19. begin
  20. if test.x<>2 then
  21. halt(1);
  22. if test.y<>2 then
  23. halt(2);
  24. end.