By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,662 Members | 1,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,662 IT Pros & Developers. It's quick & easy.

Reference Usage

P: n/a
From the tests that I've run using references, it appears as if the below is
true...is this the case:

dim c as new myclass()
dim b as Class
b=c
dim c as new myclass()

When I then change properties in c, they are not reflected in b since b
contains a reference to the first instance of the object myclass created and
not to c which now contains a second instance of the object myclass...is this
correct?
--
Dennis in Houston
Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies

P: n/a
Dennis wrote:
From the tests that I've run using references, it appears as if the below is
true...is this the case:

dim c as new myclass()
dim b as Class
b=c
dim c as new myclass()

When I then change properties in c, they are not reflected in b since b
contains a reference to the first instance of the object myclass created and
not to c which now contains a second instance of the object myclass...is this
correct?


Yep you are correct.

Chris
Nov 21 '05 #2

P: n/a
Thanks...I'm actually beginning to understand reference objects (I think).
--
Dennis in Houston
"Chris" wrote:
Dennis wrote:
From the tests that I've run using references, it appears as if the below is
true...is this the case:

dim c as new myclass()
dim b as Class
b=c
dim c as new myclass()

When I then change properties in c, they are not reflected in b since b
contains a reference to the first instance of the object myclass created and
not to c which now contains a second instance of the object myclass...is this
correct?


Yep you are correct.

Chris

Nov 21 '05 #3

P: n/a
Dennis,

See my sample in your other question thread.
And please don't multipost the same kind of questions, when the thread is
obviously still open.

Cor
Nov 21 '05 #4

P: n/a
"Dennis" <De****@discussions.microsoft.com> schrieb
From the tests that I've run using references, it appears as if the
below is true...is this the case:

dim c as new myclass()
dim b as Class
b=c
dim c as new myclass()

When I then change properties in c, they are not reflected in b
since b contains a reference to the first instance of the object
myclass created and not to c which now contains a second instance of
the object myclass...is this correct?


Correct.

Armin
Nov 21 '05 #5

P: n/a
It's NOT the same question. My other question was regarding passing byVal
versus byRef. This thread is about a completely different
question!!!!!!!!!!!!!!!
--
Dennis in Houston
"Cor Ligthert [MVP]" wrote:
Dennis,

See my sample in your other question thread.
And please don't multipost the same kind of questions, when the thread is
obviously still open.

Cor

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.