<RetVar> = The name for the new sorted array.
<Value> = This array will have its value sorted based on the values from the next array.
<Value> = The values in this array will be used to sort the values for the previous array.
Sorts the data array by the values found in the sort array.
Example:
If you were to get a list of all wares available in a particular sector and store them in an array. Then go through that list and get a corresponding array of all the Minimum values for these wares, you could sort the list of wares by their minimum value based on the array containing these values.
$ware.array = Array containing all the wares from the sector.
$min.cr.array = Array containing the minimum credits for the wares.
The above arrays must have corresponding indexes. ie.
$ware.array [0] = Ware "A"
$min.cr.array [0] = Ware "A" min credits.
You could then use the following to sort $ware.array in assending order of their minimum credits.
$sorted.ware.array = sort array: data = $ware.array sort values = $min.cr.array
Command Location:
- »» General Commands
- »» Arrays
<RetVar> = sort array: data = <Value> sort values = <Value>
- »» Arrays