标签:var fun integer delphi cti func val eva ble
function DoubleVal (Val: Integer) : Integer;
begin
Val := Val * 2;
Result := Val;
end;
function DoubleRef (var Val: Integer): Integer;
begin
Val := Val * 2;
Result := Val;
end;
调用:
var
I, J: Integer;
begin
I := 2;
J := DoubleVal (I); // I = 2; J = 4;
//如果调用下面的话,
// J := DoubleRef (I); // I = 4; J = 4; i的值改变了
标签:var fun integer delphi cti func val eva ble
原文地址:https://www.cnblogs.com/bwdblogs/p/10344893.html