Language Reference Guide : System Classes : ListviewField Class : Sort Method
 
Share this page          
Sort Method
The Sort method sorts the ValueList of the ListviewField based on the content of one of its columns.
This method has the following syntax:
integer = ListViewField.Sort(colindex = integer[, direction = integer]
          [, casesensitive = integer][, updchoicelist = integer]
          [, coldatatypecode = smallint][, emptyvaluecomparison = smallint])
This method has the following parameters:
colindex
Specifies the index of the column to be sorted on. Its value must be between 1 and ColAttributes.LastRow.
direction
Determines the sort direction. Must be either AS_ASC or AS_DESC.
Default: AS_ASC
casesensitive
Determines whether the Sort method sorts strings with case sensitivity. Must be either TRUE or FALSE.
Default: FALSE
updchoicelist
Determines whether the display should be refreshed to reflect changes in the value list. Must be either TRUE or FALSE.
Default: TRUE
coldatatypecode
Specifies the code of the datatype to be used for sorting the column. Valid values are:
DTC_VARCHAR
DTC_INTEGER
DTC_FLOAT
DTC_DATE
DTC_MONEY
Default: DTC_VARCHAR
Descriptions of system constant values and their numeric equivalents are listed in DatatypeCode Settings.
emptyvaluecomparison
Specifies how empty values are compared with non-empty values. Valid values are:
EVC_LT
EVC_GT
EVC_CONVERT
Default: EVC_LT
Descriptions of system constant values and their numeric equivalents are listed in EmptyValueComparison Settings.
The Sort method returns ER_OK if it is successful, or a non-zero value if it is not.