This Kind of Array Cannot be Sorted Error

You tried to sort a Boolean array or an array of objects.


Example

You tried to sort an array of objects instead of an array of alphas or numbers. For example, an array of Date objects cannot be sorted, but an array of TotalSeconds properties of Date objects can be sorted, since the TotalSeconds property is a Double.

This example array cannot be sorted.

Dim d(2) as Date
d(0)= New Date
d(1)= New Date
d(2)= New Date
d(0).year=1965
d(1).year=1970
d(2).year=1950
d. Sort

The last line of this example produces the error message.

Dim theTruth(3) as Boolean
theTruth(0)= True
theTruth(1)= True
theTruth(2)= False
theTruth(3)= False
theTruth. Sort

See Also

Sort method.