BIS fnc arrayInsert: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Some wiki formatting)
m (Some wiki formatting)
 
(2 intermediate revisions by the same user not shown)
Line 27: Line 27:
|r1= [[Array]] - a new array
|r1= [[Array]] - a new array


|x1= <code>_result = [<nowiki/>[0,1,2,3,4], ["a","b","c"], 1] [[call]] [[BIS_fnc_arrayInsert]]; {{cc|returns [0,"a","b","c",1,2,3,4]}}</code>
|x1= <sqf>private _result = [[0,1,2,3,4], ["a","b","c"], 1] call BIS_fnc_arrayInsert; // returns [0,"a","b","c",1,2,3,4]</sqf>


|seealso=
|seealso=
}}
}}

Latest revision as of 14:52, 13 July 2022

Hover & click on the images for description

Description

Description:
Inserts the elements of one array into another, at a specified index. Neither arrays are touched by reference, a new array is returned.
Execution:
call
Groups:
Arrays

Syntax

Syntax:
[array1, array2, index] call BIS_fnc_arrayInsert
Parameters:
array1: Array - array to insert into
array2: Array - array to be inserted
index: Number - insertion index
Return Value:
Array - a new array

Examples

Example 1:
private _result = [[0,1,2,3,4], ["a","b","c"], 1] call BIS_fnc_arrayInsert; // returns [0,"a","b","c",1,2,3,4]

Additional Information

See also:
See also needed

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note