Reference Usage

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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 said:
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
 
Dennis said:
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
 
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
 
It's NOT the same question. My other question was regarding passing byVal
versus byRef. This thread is about a completely different
question!!!!!!!!!!!!!!!
 
Back
Top