tbs0294.pp 445 B

12345678910111213141516171819
  1. { this is allowed in BP !!!
  2. but its complete nonsense because
  3. this code sets parameter test
  4. so the return value can not be set at all !!!!!
  5. of course in Delphi you can use result so there it
  6. makes sense to allow this ! PM }
  7. function test(var test:longint):longint;
  8. begin
  9. test:=1;
  10. end;
  11. var t : longint;
  12. begin
  13. t:=2;
  14. { here you get garbage value with BP ! }
  15. Writeln('test(t=2) = ',test(t));
  16. Writeln('t after test = ',t);
  17. end.