sortType
Type: InternalPseudoArrayInteger
Availability: Read or write at run time only
The sortType property of the Table control specifies the type of data that the cell text represents. Use this property to control how to interpret the cell text when a table is sorted.
Each sheet of a Table control can have in the range zero through six sorted columns, and each of these columns has a corresponding sortType entry that defaults to normal alphanumeric sorting.
The values for the sortType property, represented by Table class constants, are listed in the following table.
Table Class Constant | Cell Data Type | Integer Value |
---|---|---|
SortType_Alpha | Default alphanumeric sorting | 0 |
SortType_Numeric | Numeric sorting (including decimals and negative signs) | 1 |
SortType_Date | Date | 2 |
SortType_Time | Time | 3 |
SortType_TimeStamp | Timestamp | 4 |
The numeric evaluation uses the locale of the user for the separator, decimal place, and negative sign character handling. In addition:
-
A leading - character is always treated as a negative sign, regardless of the locale definition and placement of the negative sign.
-
A numeric value enclosed in parentheses (for example, (123.45)) is treated as negative (that is, -123.45 for the preceding example).
-
A numeric value is constructed from the cell text up to the first invalid character or the end of the string. For example, '1,234.45invalid' treats the numeric value as '1,234.45'. If there is no valid leading numeric portion, the sort uses zero (0) for the numeric value of the cell.
When the sortType property has a value of SortType_Time or SortType_TimeStamp, text in the cells is typecast as a
If the text field of a cell is not a valid instance of the requested primitive type, the resulting sorting is undefined. The code fragment in the following example shows the use of the sortType property.
if index = 7 then table1.sortColumn[1] := 2; table1.sortType[1] := table1.SortType_Numeric; table1.sortAsc[2] := true; table1.sortCased[2] := true; elseif index = 8 then
You can also set the sort type by using the