I tested this as follows:
[code]dim colours() as string = array (“red”, “blue”, “green”, “red”, “red”, “green”, “blue”)
dim values() As integer = array (0, 1, 2, 3, 4, 5, 6)
app.AutoQuit = true
colours.SortWith (values)
msgbox (“Done”)
quit[/code]
And examining the colours
and values
array afterwards and the sort is done as I would wish - the elements of the same colour are grouped together (the order within each group doesn’t matter to me). However, the SortWith documentation appears to imply that, in cases such as the above where the base array (colours
in this case) has non-unique values, the results are undefined. Does this mean that the actual behaviour of SortWith in this and similar cases may change from release to release? And if so, why?