PML Customisation User Guide

Arrays : Sorting Arrays using the VAR Command
Where a multi-level sort is required it is still necessary to use the older facilities of the VAR command to perform the sort. Using a different example, look at the arrays !Car, !Colour and !Year:
The sorted index values are put into the array !Index, (for clarity shown here with the rows of the original arrays they are pointing to),
Sorts in ascending case-independent alphabetic order.
Sorts in alphabetic in reverse order
Sorts in descending case-independent alphabetic order.
Forces an ascending numerical sort on numbers held as strings.
Forces a descending numerical sort on numbers held as strings.
!Index would then have only 9 elements as the value in the original row 10 was a second reference to a 1993 yellow Ford which is discarded.
Again !Index would have only 9 elements as the original row 8 is discarded.
The option NOEMPTY discards rows with values that are all blanks.
This would create !Index by sorting the values in the array !Car , but would also would also create the array !Last:
A similar option FIRSTINGROUP identifies the first row of each group.

1974 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved.
AVEVA Logo