Page 1 of 1

SortStructuredArrayCustom and SortStructuredListCustom

Posted: Sat Aug 22, 2020 1:47 pm
by User_Russian
Need the functions SortStructuredArrayCustom and SortStructuredListCustom to sort by multiple fields of the structure.
For example.

Code: Select all

Structure Struct
  a.l
  b.u
EndStructure

Procedure SortCompare(*x.Struct, *y.Struct)
  If *x\a > *y\a Or (*x\a = *y\a And *x\b > *y\b)
    ProcedureReturn #True
  Else
    ProcedureReturn #False
  EndIf
EndProcedure

NewList MyList.Struct()

SortStructuredListCustom(MyList(), @SortCompare())

Re: SortStructuredArrayCustom and SortStructuredListCustom

Posted: Sat Aug 22, 2020 3:47 pm
by Little John
This has already been requested:
viewtopic.php?f=3&t=68690