Hi out there,

I have several collection classes that contain Data from a database.
I need to add a .sort method for each of them, where I dynamically pass the property to be sorted and the sort-direction (ASC / DESC).

For example lets assume I'd have a collection class with employees, and I want to sort it by name and (in another step) by age.

now I would like to do something like this:

cEmployees.sort("Name", "DESC")
cEmployees.sort("BirthDate", "ASC")

Now the first problem is that it seems that the collections (built with the class builder utility of VB) do not contain a properties collection, though all of them "have" properties. And If I try to implement it myself, I can't do properties.add. Very strange.

I really would like to write the method in a way that I could just copy and paste the method to each class, as the projekct contains more than 50 collection classes ...


Can anyone help with this?