What's the difference between ref attribute and var parameter?
What's the difference between ref attribute and var parameter?
function FunctionName(const [Ref] parameter1: Class1Name; [Ref] const parameter2: Class2Name);
function DoubleByRef(var X: Integer): Integer;
Is it the same thing?
function FunctionName(const [Ref] parameter1: Class1Name; [Ref] const parameter2: Class2Name);
function DoubleByRef(var X: Integer): Integer;
Is it the same thing?
Leif Uneus It's a useful feature!
ReplyDeleteLeif Uneus what it might be useful? some simple example?
ReplyDeleteJacek Laskowski It is useful if you want to make sure that a const parameter is passed by reference.
ReplyDeleteDavid Heffernan pretty much covers a simple use case here: stackoverflow.com - Is the [Ref] attribute for const record parameters useful?