tw1409.pp 559 B

123456789101112131415161718192021222324252627282930
  1. {$MODE objfpc}
  2. type
  3. TPoint = record
  4. x, y: Integer;
  5. end;
  6. procedure Test(const Args: array of TPoint);
  7. begin
  8. {$ifndef VER1_0}
  9. writeln(length(Args));
  10. if length(Args)<>2 then
  11. halt(1);
  12. {$endif VER1_0}
  13. writeln(high(Args));
  14. if high(Args)<>1 then
  15. halt(1);
  16. writeln(Args[0].x,',',Args[0].y);
  17. if (Args[0].x<>10) or (Args[0].y<>20) then
  18. halt(1);
  19. writeln(Args[1].x,',',Args[1].y);
  20. if (Args[1].x<>30) or (Args[1].y<>40) then
  21. halt(1);
  22. end;
  23. const
  24. p1: TPoint = (x: 10; y: 20);
  25. p2: TPoint = (x: 30; y: 40);
  26. begin
  27. Test([p1,p2]);
  28. end.