Generalising sort routine
Hi,
I wrote a routine to sort 2-dimensional integer arrays, but I would like to extend it to sort any data. If I would use another programming language I would add the "Compare" function and "Exchange" routine as parameters, so the interface would be someting like: Sub Sort( ObjectsToSort() , LowBound, HighBound, CompareFunc, ExchangeSub). Unfortunately passing functions/subs as parameters does not seem to be possible in VBA. Anyone has an idea how to accomplish this? I was thinking of creating classes with each their own Sort method, but have no idea how to do this in VBA. Any info on the net about how to create classes/objects in VBA? Greetz, Lex |
All times are GMT +1. The time now is 06:48 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com