druven
May 22nd, 2005, 07:09 AM
Hello all,
Suppose I have class B which inherits class A:
Class A
{
dim x as integer
}
Class B
inherits A
{
dim y as integer
}
I have an instance of class B, and I want to get from it an instance of class A with same property values. For example:
dim b as new B
b.x = 1
b.y = 2
dim a as A
a = b.GET_BASE_CLASS_IN_SOME_WAY
messagebox.show(a.x) //will show '1' in messagebox
messagebox.show(a.y) //error - prohibited
What can I do in the fifth line of code to get a reference to a ??
Help will be fully appreciated, thanks
Suppose I have class B which inherits class A:
Class A
{
dim x as integer
}
Class B
inherits A
{
dim y as integer
}
I have an instance of class B, and I want to get from it an instance of class A with same property values. For example:
dim b as new B
b.x = 1
b.y = 2
dim a as A
a = b.GET_BASE_CLASS_IN_SOME_WAY
messagebox.show(a.x) //will show '1' in messagebox
messagebox.show(a.y) //error - prohibited
What can I do in the fifth line of code to get a reference to a ??
Help will be fully appreciated, thanks