I've googled for articles on VB6's support for polymorphism, but all of the articles that I read merely mentioned that you can make a derived class inherit properties and methods from a derived class. None of the three or four articles that I read mentioned whether or not VB6's polymorphism allowed you to pass the derived classes as parameters of the base class type.
If you were to have a class named Bunny
, which was derived from a class named Animal
, could you pass a variable of type Bunny
to the following function?
Public Sub Chase(thePerson as Person, theAnimal as Animal)
Do While thePerson.position <> theAnimal.position
...
Loop
End Sub