"sortDyn"
Sorts the table by columns passed in an array.
Synopsis
setValue(string shape, "sortDyn", [bool/dyn_bool ascending = true], dyn_string
Names);
getValue( string shape, "sortDyn", dyn_string &Names);
shape.sort([bool ascending = true], dyn_string Names);
Parameters
Parameter | Description |
---|---|
shape | Name of the object |
ascending |
TRUE = Sort ascending FALSE = Sort descending The parameter "ascending" can only be used with "setValue" (writing values). You can also sort by multiple columns with each in ascending or descending order. For this, use the dyn_bool parameter. For an example, see "sort". |
Names | Array of column names |
Description
The function "sortDyn" allows sorting columns in the same way as "sort", the only difference being that the names of the columns are passed or queried as a dynamic array "Names".
Example
main()
{
shape table=getShape("table123");
dyn_string ds;
ds=makeDynString("Surname", "First name", "Age");
table.sortDyn(ds);
}
Assignment
Table