|
|||||||
VERBatim - V121The base sort processor. It is passed the array to sort along with the length of the elements in the array. NOTE all array elements must be the same length for this routine to work. It is the responsibility of the programmer to ensure that data is correctly justified to provide an alpha/numeric sort. Descending sorts are provided by INVERTing the data to be sorted before calling V121 then INVERTing it back upon return. As an array element is passed, the array delimiter is unnecessary. If an array delimiter is used it should be counted as a data character when passing element length, and a trailing delimiter should be included. 0001 A = "ZZ" :@FM: "AAA" :@FM: "AAB" :@FM 0002 * Ascending left justified sort 0003 SORT.A = A "L#3" 0004 CALL V121(SORT.A,4) 0005 CALL MSG(SORT.A, "", "", "") 0006 0007 * Descending left justified sort 0008 SORT.A = A "L#3" 0009 SORT.A = INVERT(SORT.A) 0010 CALL V121(SORT.A,4) 0011 SORT.A = INVERT(SORT.A) 0012 CALL MSG(SORT.A, "", "", "") 0013 0014 A = 1 :@FM: 99 :@FM: 23 :@FM 0015 * Ascending right justified sort 0016 SORT.A = A "R#2" 0017 CALL V121(SORT.A,3) 0018 CALL MSG(SORT.A, "", "", "") 0019 0020 * Descending right justified sort 0021 SORT.A = A "R#2" 0022 SORT.A = INVERT(SORT.A) 0023 CALL V121(SORT.A,3) 0024 SORT.A = INVERT(SORT.A) 0025 CALL MSG(SORT.A, "", "", "") 0026 0027 * Incorporating V120, note use of fixed length (5 char) string with two 0028 * portions of data @FM delimited 0029 A = "ZZ" :@FM: "01AA" :@FM: "02" 0030 * Ascending left justified sort 0031 CALL V121(A,5) 0032 CALL V120(A,5) 0033 CALL MSG(A, "", "", "") (Volume 1, Issue 9, Pages 5,6) |
|||||||
| |||||||