Arma 3 Scripting

BIS_fnc_removeIndex

  • Arma 3 v0.50
  • First in Arma 2 v1.00

Function · Markdown · JSON · original wiki page

Description

Takes an array, and returns a new array with the specified index(es) removed. This takes the array passed in the first parameter, and returns an array that has the index number in the second parameter removed. If a third parameter is passed, then a range of indexes will be removed. Alternatively, an array of indices to remove can be passed in the second parameter.

Note

Arma 3: Use deleteAt or deleteRange instead.

Syntax

Syntax 1

[array, startIndex, endIndex] call BIS_fnc_removeIndex

Parameters:

Returns: Array - new array with new values

Syntax 2

[array, indices] call BIS_fnc_removeIndex

Parameters:

Returns: Array - new array with new values

Examples

Example 1

private _array = [0,1,2,3,4];
[array, 0] call BIS_fnc_removeIndex; // returns [1,2,3,4]

Example 2

private _array = [0,1,2,3,4];
[_array, 0, 4] call BIS_fnc_removeIndex; // returns []

Example 3

private _array = [0,1,2,3,4];
[_array, [0,4]] call BIS_fnc_removeIndex; // returns [1,2,3]

See also

deleteAt · deleteRange