SortListByListAsc
From Original War Support Wiki
SAIL Functions/S -> SortListByListAsc
Contents |
Description
This function orders the values in the first list according to the corresponding values in the second list (ascending order).
Parameters
SortListByListAsc(first_list, second_list)
Examples
We have four human units: Herman, Bill, Grant and Silvan. We want a list with these units sorted by their skill in combat (ascending order). Their skill in combat are: Herman -> 3, Bill -> 6, Grant -> 1, Silvan -> 5.
SortListByListAsc([Herman, Bill, Grant, Silvan], [3, 6, 1, 5]);
The function now associates "Herman" to the number "3", "Bill" to the number "6" and so on. The second list is now sorted ascending and the function returns the first list sorted accordingly, so the result is:
[Grant, Herman, Silvan, Bill]