tb0232.pp 622 B

123456789101112131415161718192021222324252627282930313233343536
  1. { Old file: tbs0272.pp }
  2. { No error issued if wrong parameter in function inside a second function OK 0.99.13 (PFV) }
  3. program test_const_string;
  4. function astring(s :string) : string;
  5. begin
  6. astring:='Test string'+s;
  7. end;
  8. procedure testvar(var s : string);
  9. begin
  10. writeln('testvar s is "',s,'"');
  11. end;
  12. procedure testconst(const s : string);
  13. begin
  14. writeln('testconst s is "',s,'"');
  15. end;
  16. procedure testvalue(s : string);
  17. begin
  18. writeln('testvalue s is "',s,'"');
  19. end;
  20. const
  21. s : string = 'test';
  22. conststr = 'Const test';
  23. begin
  24. testvalue(astring('e'));
  25. testconst(astring(s));
  26. testconst(conststr);
  27. end.