---
title: "sortInts"
canonical: "https://help.vicon.com/space/Shogun113/84223041/sortInts"
format: markdown
---
# Description

Sort a list of integers numbers stored in an array.

## Functional area

System

# Command syntax

## Syntax

|  |
| --- |
| `sortInts intArray [-d]` |

### Arguments

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `intArray` | integer array | yes | The array to sort |

### Flags

> Macro (scroll-tablelayout)

| **Name** | **Flag arguments** | **Argument type** | **Exclusive to** | **Comments** |
| --- | --- | --- | --- | --- |
| `d` | 0 | — | — | Sorts in descending order. Default is to sort in ascending order. |

## Return value

integer array

Returns the sorted array. 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// 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

- [sortFloats](https://vicon-help.atlassian.net/wiki/spaces/Shogun113/pages/84220352)
- [sortStrings](https://vicon-help.atlassian.net/wiki/spaces/Shogun113/pages/84216642)