|
Purpose |
With
Sort
you can sort the values of an
array of variables. You can also sort the rows of a table of variables.
Arrays and tables of variables consist of single cell variables where a
part of the variable name is a row or column index 1,2,3,... |
|
Examples |
Sort
"mx_matnr_"
The values of the variables V[mx_matnr_1], V[mx_mantr_2], V[mx_matnr_3]
,... are put into ascending order.
Sort
"mx_tab_%row_%col"
-descending rowcount=84
colcount=12
orderby=3
The rows of a table consisting of variables V[mx_tab_1_1],
V[mx_tab_1_2], V[mx_tab_1_3], ..... until V[mx_tab_84_12] are put into
descending order, depending on the value of column number 3.
|
|
Format |
Sort
"varname"
Sorts a one-dimensional array of variables V[varname1], V[varname2],..
Sort
"varname_%row_%col"
Sorts all rows of a 2-dimensional array (table) of variables, where
"%row" is replaced by the row index and "%col"
by the column
index.
|
Additional
options |
| -descending |
Descending ordering |
|
rowcount= |
Number of rows to be sorted. If not specified, GuiXT determines
the row count automatically, counting the existing variables. |
|
colcount= |
Number of columns. If not specified, a one-dimensional array is
assumed, i.e. colcount=1. |
|
orderby= |
Specifies the number of the column that determines the ordering.
If not specified it is assumed to be the first column. |
|
|
Additional
hints |
- The columns can
contain strings, numbers or dates; the ordering is type-specific,
e.g 89 before 100 but A98 after A100.
- The sort is stable;
this means that rows with equal sort key are not changed. As a
consequence, sorting by multiple columns can be implemented using
one sort statement for each column, starting with the last sort
column.
|