I've got a mustinherit class with two subclasses.
Lets say the class is "Shape" and the subclasses are "Circle" and "Triangle"
Now I've got an array of shapes containing both circles and triangles.
How can I check which type the item is?
I noticed that this doesn't work:
VB Code:
if array(i).getType.equals(Shape) then end if
But this does:
VB Code:
dim s as Shape ... if array(i).getType.equals(s.getType) then end if
It seems stupid to me that I should create a variable of the type, so isn't there a better way?




Reply With Quote