Extending from the same basic type.
I don't assume that you (as realworld example) would store car, turnips and pens in the same list. you would have a lit for vegetables, for vehicles and one for pens of all kind and then extend turnip from vegetable, car from vehicle and any pen type you use from pen.
Now you can implement basic functionality on those base type that those kind of things have and that stuff you don't implement but that must be present can still pe put in as method xyz() Abstract so extending types must implement it.
that way you can just cast to the base type in the for ... = eachin list part instead of using a select case structure to do "individual casting" that might not even be needed.
But this might depend on what you want to achieve.
A simple example of such a thing is Entity in Blitz3D for example ... they all extend from it and share the "base featuerset" ie entity commands
I don't assume that you (as realworld example) would store car, turnips and pens in the same list. you would have a lit for vegetables, for vehicles and one for pens of all kind and then extend turnip from vegetable, car from vehicle and any pen type you use from pen.
Now you can implement basic functionality on those base type that those kind of things have and that stuff you don't implement but that must be present can still pe put in as method xyz() Abstract so extending types must implement it.
that way you can just cast to the base type in the for ... = eachin list part instead of using a select case structure to do "individual casting" that might not even be needed.
But this might depend on what you want to achieve.
A simple example of such a thing is Entity in Blitz3D for example ... they all extend from it and share the "base featuerset" ie entity commands