Array SortWith problem

I have created a class called Card with an integer property called index and I have an array called a_test of 5 elements of the Card class which I want to sort into ascending order by the index property. This routine is based on the one in the Development Centre examples but it creates the issue “This kind of array can not be sorted”. I am using Xojo 2017 release 3. Any suggestions? (I have not populated the array as yet - I am just trying to get it past the Xojo syntax checker at this stage)

[code]Dim a_test(4) as Card
Dim indeces() as integer

For n as integer = 0 To 4
indeces.append(a_test.index(n))
Next
a_test.SortWith(indeces)
[/code]

indeces.sortWith a_test

All working now. Thanks very much - I must have read the example back to front!