User Tools

Site Tools


setsort_apply_a_sort_order_to_the_browse_.htm
Navigation:  ABC Library Reference > BrowseClass > BrowseClass Methods >====== SetSort (apply a sort order to the browse) C6H0009.jpg ====== Previous pageReturn to chapter overviewNext page

SetSort( order, force reset ), VIRTUAL, PROC

blk2blue.jpg

SetSort Applies a specified sort order to the browse list.
order An integer constant, variable, EQUATE, or expression that specifies the sort order to apply.
force reset A numeric constant, variable, EQUATE, or expression that tells the method whether to reset the browse conditionally or unconditionally. A value of zero (0 or False) resets the browse only if circumstances require (sort order changed, reset fields changed, first time loading); a value of one (1 or True) unconditionally resets the browse.

The SetSort method applies the specified sort order to the browse list and returns one (1) if the sort order changed; it returns zero (0) if the sort order did not change. Any range limits, locators, and reset fields associated with the sort order are enabled and applied.

The order value is typically a value returned by the AddSortOrder method which identifies the particular sort order. Since AddSortOrder returns sequence numbers, a value of one (1) applies the sort order specified by the first call to AddSortOrder; two (2) applies the sort order specified by the next call to AddSortOrder; etc. A value of zero (0) applies the default sort order.

Implementation:

The ResetSort method calls the SetSort method.

Return Data Type:     BYTE

Example:

IF FIELD() = ?FirstTab            !if first tab selected

 IF MyBrowse.SetSort(1,0)         !apply the first sort order

  MyBrowse.ResetThumbLimits       !if sort changed, reset thumb limits

 END

 MyBrowse.UpdateBuffer            !update file buffer from selected item

END

See Also:     AddRange, AddResetField, AddSortOrder, ResetSort

setsort_apply_a_sort_order_to_the_browse_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1