SortColumn Method (LISTVIEW)
PLBCMP GUI Only
The SortColumn method orders one to four columns of a LISTVIEW object. The method uses the following format:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A LISTVIEW object that is sorted.
return
Optional. A Numeric Variable that indicates the success or failure of the method.
col
Required. A decimal number or Numeric Variable that specifies the zero-based column that is sorted.
type
Required. A decimal number or Numeric Variable that specifies the type of sort.
mask
Optional. A Character String Variable or literal that specifies a date or time mask.
col1 - col3
Optional. A decimal number or Numeric Variable that specifies the zero-based column that is sorted.
type1 - type3
Optional. A decimal number or Numeric Variable that specifies the type of sort.
mask1 - mask3
Optional. A Character String Variable or literal that specifies a date or time mask. The mask string may also specify a filter identification for a numeric sort type.
Flags Affected: EOS, OVER, ZERO
Note the following:
{type} must be one of the following:
|
Value |
Sort Type |
|
0 |
column ignored |
|
1 |
alpha ascending |
|
2 |
alpha descending |
|
3 |
numeric ascending |
|
4 |
numeric descending |
|
5 |
date ascending |
|
6 |
date descending |
|
7 |
time ascending |
|
8 |
time descending |
|
9 |
timestamp ascending |
|
10 |
timestamp descending |
|
11 |
case insensitive alpha ascending (8.7) |
|
12 |
case insensitive alpha descending (8.7) |
When a value of zero is specified for {type}, the associated sort column is ignored and not included in the sort process. A failure return value is given when a valid (non-zero) value is not specified for at least one sort column.
A date mask value contains dd for day, mm for month, yy or yyyy for year. The default mask is "mm-dd-yy".
A date mask specified as 'm/d/yy' allows dates that include either 1 or 2 character digits for the month or day to be sorted correctly. (9.6B)
Examples of Data using 'm/d/yy' date mask:
|
Unsorted |
Sorted Ascending |
|
6/15/13 |
1/3/13 |
|
6/5/13 |
6/1/13 |
|
6/1/13 |
6/5/13 |
|
10/20/13 |
6/15/13 |
|
6/25/13 |
6/25/13 |
|
1/3/13 |
10/20/13 |
A time mask value contains hh for hour, mm for minute, ss for seconds, and xx for 100th of a second. The default mask is hh:mm:ss.xx.
A timestamp mask value contains DD for day, MM for month, YY or YYYY for year, hh for hour, mm for minute, ss for seconds, and xx for 100th of a second. The default mask is YYYYMMDDhhmmssxx.
Upon completion, {return} will contain the status of the modification as follows. $TRUE and $FALSE are defined in PLBEQU.INC:
|
Value |
Constant |
The sort ... |
|
0 |
$FALSE |
was successful. |
|
1 |
$TRUE |
failed |
If the value returned is zero, the ZERO Condition Flag is set.
The OVER and EOS Condition Flags are always cleared.
The numeric sort type can have a filter applied to the numeric data before the data is sorted. The following numeric sort filter identification strings in {mask} parameters are supported. The numeric sort type {mask} must be specified using the format of '(n)' which includes the parentheses characters and the 'n' value is in the range of '0' to '3'. Otherwise, the numeric sort type defaults to use 'No Filtering'.
|
Value |
Numeric sort ... |
|
(0) |
with no filtering. |
|
(1) |
after filtering '$' and ',' characters from the listview subitem data. |
|
(2) |
after filtering '$' and '.' characters from the listview subitem data. |
|
(3) |
after filtering '$', ',', and '.' characters from the listview subitem data. |
Example:
Execution of this SORTCOLUMN method applies a numeric filter mask that removes the '$' and ',' characters from the ListView data item string being used.
For improved performance in the Application Server environment, do not specify the optional return value and parameters unless needed.
See Also: Method Syntax, LISTVIEW Methods
![]() |