R
Rob Meade
Hi all,
Until just recently most of my functions would have all been using Byval,
when I realised the advantages of ByRef, where appropriate I have used it
instead, my question - are there any performance reasons for using ByRef
rather than ByVal?
In my (tiny) mind, I see ByRef as passing a reference to an already created
object, I can then use values of that object or do things to it, where-as
ByVal creates a separate instance of it (am I correct?) - if this is the
case, presumably I now have 2 instances of this object which need to be
destroyed - so presumably, not having to destroy two things is better?
Any info appreciated..
Regards
Rob
Until just recently most of my functions would have all been using Byval,
when I realised the advantages of ByRef, where appropriate I have used it
instead, my question - are there any performance reasons for using ByRef
rather than ByVal?
In my (tiny) mind, I see ByRef as passing a reference to an already created
object, I can then use values of that object or do things to it, where-as
ByVal creates a separate instance of it (am I correct?) - if this is the
case, presumably I now have 2 instances of this object which need to be
destroyed - so presumably, not having to destroy two things is better?
Any info appreciated..
Regards
Rob