SortColumn Method (LISTVIEW)


PLBCMP GUI Only

 

The SortColumn method orders one to four columns of a LISTVIEW object. The method uses the following format:

 

[label]

{object}.SortColumn

[GIVING {return}] USING [*Column=]{col}:

 

 

[*Type=]{type}[,[*Mask=]{mask}][:

 

 

[*Column1=]{column1}][,[*Type1=]{type1}][:

 

 

[*Mask1=]{mask1}][,[*Column2=]{column2}][:

 

 

[*Type2=]{type2}][,[*Mask2=]{mask2}][:

 

 

[*Column3=]{column3}][,[*Type3=]{type3}][:

 

 

[*Mask3]={mask3}]]

 

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:

  1. {type} must be one of the following:

  2.  

    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)

     

  3. 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.

  4. A date mask value contains dd for day, mm for month, yy or yyyy for year. The default mask is "mm-dd-yy".

  5. 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)

  6.  

    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

     

  7. 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.

  8. 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.

  9. Upon completion, {return} will contain the status of the modification as follows. $TRUE and $FALSE are defined in PLBEQU.INC:

  10.  

    Value

    Constant

    The sort ...

    0

    $FALSE

    was successful.

    1

    $TRUE

    failed

 

  1. If the value returned is zero, the ZERO Condition Flag is set.

  2. The OVER and EOS Condition Flags are always cleared.

  3. 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'.

  4.  

    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:

     

    LV.SORTCOLUMN USING *Column=0,*TYPE=3,*Mask="(1)"

     

    Execution of this SORTCOLUMN method applies a numeric filter mask that removes the '$' and ',' characters from the ListView data item string being used.

 

  1. 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

 



PL/B Language Reference SetLVFlags Method (LISTVIEW) SubItemHitTest Method (LISTVIEW)