Goto http://www.stucuk.netGoto http://www.atlanticaonlinewiki.comGoto http://www.game-requirements.com

SortListByListAsc

From Original War Support Wiki

Jump to: navigation, search

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]

Related functions

Personal tools
Clanbase
This is a cached copy of the requested page, and may not be up to date.

Sorry! This site is experiencing technical difficulties.
Try waiting a few minutes and reloading.

(Cannot contact the database server: MySQL functions missing, have you compiled PHP with the --with-mysql option? )


You can try searching via Google in the meantime.
Note that their indexes of our content may be out of date.