My understanding is that, unless the value of a variable is passed specifically ByRef, only the value is passed, and the variable is not changed. However, I’ve been perplexed by the experience of declaring a variable, then assigning its value to a Computed Property in a Class, only to discover on inspection that the original variable, which I’d intended to use for another Computed Property has been changed to the computed value. Can anyone help me in my confusion? Please!
Is the ‘variable’ an object / class, or is it a simple variable like an integer?
Jeff’s question is relevant because passing by “value” does not mean passing a copy or clone.
When you pass ByVal any Object or Array, you are actually passing a reference to the object, so changes made to that array or object will be reflected in the calling method. It is the same as assigning an array or object to a second variable or property.
Debugger watch points would be very helpful in such a situation … Here’s an oldie but a goodie:
Many thanks to everyone who responded to this query. It seems to have been solved by the implementation of API 2.0.