Partager via


SSortOrder (Compact 7)

3/12/2014

The SSortOrder structure defines how to sort rows of a table, describing the column to use as the sort key and the direction of the sort.

Syntax

struct { 
  ULONG ulPropTag; 
  ULONG ulOrder; 
} SSortOrder, FAR *LPSSortOrder; 

Members

  • ulPropTag
    Property tag identifying the sort key or, for a categorized sort, the category column.
  • ulOrder
    The order in which the data is to be sorted. Possible values are as follows:

    TABLE_SORT_ASCEND

    The table should be sorted in ascending order.

    TABLE_SORT_COMBINE

    The sort operation should create a category that combines the property identified as the sort key column in ulPropTag with the sort key column specified in the previous SSortOrder structure.

    TABLE_SORT_COMBINE can be used only when the SSortOrder structure is being used as an entry in an SSortOrderSet structure to specify multiple sort orders for a categorized sort. TABLE_SORT_COMBINE cannot be used in the first SSortOrder structure in an SSortOrderSet structure.

    TABLE_SORT_DESCEND

    The table should be sorted in descending order.

Remarks

An SSortOrder structure is used to describe how to perform either a standard sort operation or a categorized sort operation. SSortOrder structures are typically combined into an SSortOrderSet structure, used in IMAPITable::SortTable, to describe multiple sort keys and directions.

The range of allowable columns in a table that can be used as sort keys depends on the provider. Columns that are part of the current column set can always be used as sort keys.

The ulOrder member indicates both directional order and categorization information. Rows can be sorted in either an ascending or descending sequence with all NULL entries placed last.

The TABLE_SORT_COMBINE value indicates that the column specified in ulPropTag should be combined with the previous category column to form a composite category. That is, instead of categorizing on unique values of individual columns, TABLE_SORT_COMBINE allows categorization on unique values of a combination of columns. A single category could be defined, for example, to group messages received from a particular sender on a particular subject. Using TABLE_SORT_COMBINE reduces the number of category rows that are displayed.

Sorting on multivalued columns is not universally supported by all table implementations. If supported, you can identify the sort key as a multivalued column by using the MVI_PROP macro to apply the MV_FLAG to the property tag in the ulPropTag member. Sorting on a multivalued column is based on using the individual values.

Requirements

Header

mapidefs.h

See Also

Reference

MAPI Structures
SSortOrderSet