Navigation: ABC Library Reference > ViewManager > ViewManager Methods >====== SetSort (set the active sort order) ====== | |
SetSort( sortnumber ), VIRTUAL
SetSort | Set the view's active sort order. |
sortnumber | An integer constant, variable, EQUATE, or expression that specifies the sort order to use. Sort orders are numbered in the sequence they are added by the AddSortOrder method. |
The SetSort method sets the view's active sort order and returns a value indicating whether the active sort (sortnumber) changed.
Implementation:
SetSort returns one (1) if the sortnumber changed; otherwise it returns zero (0).
Return Data Type: BYTE
Example:
CustSort = MyView.AddSortOrder(ORD:ByCustomer) !sort by customer no
MyView.AddRange(ORD:CustNo,Relate:Orders,Relate:Customer) !range limit by parent file
OrderSort = MyView.AddSortOrder(ORD:ByOrder) !sort by order no
MyView.AddRange(ORD:OrderNo) !range limit by current
!value of ORD:OrderNo
!program code
IF MyView.SetSort(CustSort) !set active sort order
MESSAGE('New Sort Order') !acknowledge new order
END
See Also: AddSortOrder