tw18859.pp 493 B

12345678910111213141516171819202122232425262728293031323334353637
  1. { %OPT=-gh }
  2. Program project1;
  3. {$mode objfpc}
  4. {$h+}
  5. type
  6. trec = record
  7. s: string;
  8. end;
  9. procedure test1(values: array of string);
  10. begin
  11. if paramcount = 0 then
  12. values[0] := values[0] + '1'
  13. else
  14. values[0] := '1';
  15. end;
  16. procedure test2(values: array of trec);
  17. begin
  18. if paramcount = 0 then
  19. values[0].s := values[0].s + '1'
  20. else
  21. values[0].s := '1';
  22. end;
  23. var
  24. tr: trec;
  25. begin
  26. tr.s := 'test';
  27. uniquestring(tr.s);
  28. test1([tr.s]);
  29. test2([tr]);
  30. end.