by Kamilche (35 Submissions)
Category: Object Oriented Programming (OOP)
Compatability: Visual Basic 5.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (2 Votes)
This example illustrates how to set up inheritance in VB, without using containment ('has-a') processing. The data structure is very flexible, as each class and object instance is basically a hash table (a dictionary in VB). It usess 'CallByName' to call the appropriate routine based on type, at runtime. Note that this could be made much more efficient and speedy by using a custom hash table class and enums instead of strings for properties, but I left that out to simplify this example.