Arma 3 Scripting

Function in Arrays

BIS_fnc_arrayShift

Also available as Markdown and JSON, or read the original wiki page.

Description

This function removes the first (leftmost) element of an array and returns it.

The array is passed by reference so changes inside the function will be reflected outside of it.

Note

Arma 3: In Arma 3, use array deleteAt 0.

Syntax

[array] call BIS_fnc_arrayShift

Parameters:

Returns: Anything - the removed element

Examples

Example 1

private _myArray = ["2", "report", "status"];
_removedElement = [_myArray] call BIS_fnc_arrayShift;    // array is -within an array-
_removedElement == "2";                                    // true
_myArray isEqualTo ["report", "status"];                // true

See also

deleteAt · pushBack