fpc/tests/tbs0294.pp
1999-12-02 13:37:37 +00:00

20 lines
445 B
ObjectPascal

{ this is allowed in BP !!!
but its complete nonsense because
this code sets parameter test
so the return value can not be set at all !!!!!
of course in Delphi you can use result so there it
makes sense to allow this ! PM }
function test(var test:longint):longint;
begin
test:=1;
end;
var t : longint;
begin
t:=2;
{ here you get garbage value with BP ! }
Writeln('test(t=2) = ',test(t));
Writeln('t after test = ',t);
end.