Re: Assignment by reference or value
From: Bob Phillips (bob.phillips_at_notheretiscali.co.uk)
Date: 02/16/04
- Next message: Shamsul Islam: "Delate Names"
- Previous message: Yohan: "Macro freezes Excel"
- In reply to: Mark: "Assignment by reference or value"
- Next in thread: Mark: "Re: Assignment by reference or value"
- Reply: Mark: "Re: Assignment by reference or value"
- Reply: onedaywhen: "Re: Assignment by reference or value"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 16 Feb 2004 09:39:36 -0000
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.
I accept that you cannot pass C to the Button_Click event, but as it is a
public variable it is accessible within the form code, as you show, which
means that if you are happy changing it there, you do not need A.
--
HTH
Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
"Mark" <no@email.com> wrote in message
news:c0q1mi$igi$1@news.net.uni-c.dk...
> 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
>
>
- Next message: Shamsul Islam: "Delate Names"
- Previous message: Yohan: "Macro freezes Excel"
- In reply to: Mark: "Assignment by reference or value"
- Next in thread: Mark: "Re: Assignment by reference or value"
- Reply: Mark: "Re: Assignment by reference or value"
- Reply: onedaywhen: "Re: Assignment by reference or value"
- Messages sorted by: [ date ] [ thread ]