Page History
Book - Sort Method
| Panel | ||
|---|---|---|
| ||
Sort the list |
Member of Book (PRIM_BOOK)
Parameters
Name | Type | Data Type | Description |
|---|---|---|---|
Key | *Input | Variant | User defined sort order |
Order | *Input (Optional) | Enumeration | Order in which to sort the list |
Details
The Sort method is used to begin the sorting process within the Book.
...
Sorting is entirely user defined and it is therefore necessary to supply the Key (the 'value' that is being sorted) and the Order to the sort routine. This information is then used in the OnSort method.
Example
This example shows the redefined OnSort method implemented by the design reusable part.
...
Mthroutine Name(OnSort) Options(*Redefine)
Case (#Key)
When (= EMPNO)
#Result := #Empno.Compare( (#CompareTo.Design *As #EmployeePart).Empno )
When (= GIVENAME)
#Result := #Givename.Compare( (#CompareTo.Design *As #EmployeePart).Givename )
When (= SURNAME)
#Result := #Surname.Compare( (#CompareTo.Design *As #EmployeePart).Surname )
Endcase
Endroutine