Assignment by reference or value
Bob, I not sure that's right. My understanding is that A is a
reference (pointer) to C. A isn't a new Collection object in its own
right because it hasn't been instantiated. Rather it will just hold
the address in memory of C. Hence A *will* hold the same data as C.
Jamie.
--
"Bob Phillips" wrote in message ...
Mark,
As far as I can tell from your description, A is neither a copy nor a
reference. It is not a copy as it will hold different data than C, and it is
not a reference as it is a new object in it's own right. It will have a
similar structure as C, being a collection, but will occupy a separate chunk
of memory, and this may be what you mean by copy.
"Mark" wrote in message
...
Hi NG
I have a question about assignment of variables by reference or value.
I have a module where a collection C is defined as public.
In my form i want to use that information. Because i use a callback e.g.
button_click() i can not parse C in to the function. Instead i do the
following in the button_click() callback
dim A as collection
A = modSomething.C
Is A then a copy of C or is it a reference?
For performance reasons i would like it to be a reference.
Regards
Mark
|