Sort Method (DATATABLE)
10.5, PLBCMP GUI Only
The Sort method orders the DATATABLE rows based on the values in one to four columns. The method uses the following format:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A DATATABLE object.
return
Optional. A Numeric Variable that indicates the success or failure of the method.
column
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.
column1 - column3
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.
Flags Affected: EOS, OVER, ZERO
Note the following:
The EOS flag is always cleared.
A zero is returned for success or a value of one for failure.
The ZERO flag is set if the {return} value is zero.
The OVER flag is set if the {return} variable is too small to receive the return value.
The {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 |
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.
Examples of Data using 'm/d/yy' date mask:
|
Unsorted |
Sprted 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.
See Also: Method Syntax, DATATABLE Methods
![]() |