tbs0272.pp 503 B

123456789101112131415161718192021222324252627282930313233
  1. program test_const_string;
  2. function astring(s :string) : string;
  3. begin
  4. astring:='Test string'+s;
  5. end;
  6. procedure testvar(var s : string);
  7. begin
  8. writeln('testvar s is "',s,'"');
  9. end;
  10. procedure testconst(const s : string);
  11. begin
  12. writeln('testconst s is "',s,'"');
  13. end;
  14. procedure testvalue(s : string);
  15. begin
  16. writeln('testvalue s is "',s,'"');
  17. end;
  18. const
  19. s : string = 'test';
  20. conststr = 'Const test';
  21. begin
  22. testvalue(astring('e'));
  23. testconst(astring(s));
  24. testconst(conststr);
  25. end.