Hi,
thanks for your link, though that's not what we are talking about, those are custom IComparer interface that is created by Chip, but the other poster and myself are referring to the IComparable .NET interface that you get by referencing mscorlib.dll:
https://msdn.microsoft.com/en-us/library/System.Collections.IComparer.aspx
With this, you should be able to pass the implemented IComparer class to the mscorlib ArrayList to get a custom sort, but as the other user stated, VBA is throwing an error message, when it shouldnt'.
https://msdn.microsoft.com/en-us/library/0e743hdt(v=vs.100).aspx
Public Overridable Sub Sort ( _
comparer As IComparer _
)
For your reference, what does work is implementng the .net IComparable interface and this works fine with the mscorlib.dll ArrayList's sort() method, but for some reason passing IComparer doesn't work even though the reference clearly states this should work
Cheers,
Dieter
|