Vicon Shogun banner

Description

Sort a list of integers numbers stored in an array.

Functional area

System

Command syntax

Syntax

sortInts intArray [-d]

Arguments

NameTypeRequiredComments
intArrayinteger arrayyesThe array to sort

Flags

NameFlag argumentsArgument typeExclusive toComments
d0Sorts in descending order. Default is to sort in ascending order.

Return value

integer array

Returns the sorted array.

Examples

// Demonstrate a simple sort.
int $array[3];
$array[0] = 3;
$array[1] = -1;
$array[2] = 10;
int $sortedArray[] = `sortInts $array`;
print $sortedArray;

Additional information

Related commands