ClassB inherits shared properties and methods of ClassA. Here is the
test code.
dim b as Boolean = ClassB.Visible //should be false
ClassA.Visible = true
b = ClassB.Visible //should be true
Charles Yeomans
On Apr 8, 2006, at 12:45 AM, Thom McGrath wrote:
If I have ClassA which has a shared property, visible, all
instances of ClassA share this property, right? Well if I subclass
ClassA into ClassB, do all instances of both ClassA and ClassB
share this property since ClassB is a ClassA? Or do all ClassA's
share a visible property and all ClassB's share a different visible
property?
I can't seem to figure this out on my own because the debugger
keeps crashing, and I swear there is something odd about shared
properties. In my tests, I created the very scenario described
above. I created 3 of each:
dim a,b,c as classa
dim d,e,f as classb
a = new classa
b = new classb
c = new classc
break
a.visible = true
break
d = new classb
e = new classb
f = new classb
break
d.visible = true
break
At the first break, all a,b, and c's visible was already true! This
test proved useless. So I changed a.visible to false. No effect.
Not only did all start out at true, but setting to false did
nothing. Same for classb. So I assumed that maybe visible wasn't a
good property, so I changed it to "Bounces" - same result.
I then changed it to Numbers() As Integer and appended integers
instead of changed values. Could not determine if this worked
because inspecting it in the debugger would crash it.
So my big question is, what's the deal?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>