mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-26 12:03:45 +02:00
20 lines
445 B
ObjectPascal
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.
|