When you pass an object as a procedure parameter and you don't need to pass
back any changes to the calling function, do you need the 'var' in front of
the instance name in the procedure declaration?

I routinely write procedures that receive tables and other instances that I
want the changes passed back into the calling code (i.e. passed by reference
rather than value). But since having a problem in Delphi 2 passing a
TStringList as a value parameter into a procedure I have always routinely
written 'var' to make the compiler pass the instance as a reference even
though it isn't necessary to pass it back to the caller.

That doesn't seem to apply in Delphi 3 as instances pass as value parameters
fine (the compiler presumably still passes a reference rather than the
object itself, though)


---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to