BIS fnc arrayInsert: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <nowiki>[</nowiki>" to " [<nowiki/>")
m (Some wiki formatting)
 
(24 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|= Comments
{{RV|type=function
____________________________________________________________________________________________


| arma2 |Game name=
|game1= arma2
|version1= 1.00


|1.00|Game version=
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| Inserts the elements of one array into another, at a specified index. Neither arrays are touched by reference, a new array is returned. |Description=
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| [array1, array2, index] call [[BIS_fnc_arrayInsert]] |Syntax=
|game4= arma3
|version4= 0.50


|p1= array1: [[Array]] - array to insert into |Parameter 1=
|gr1= Arrays


|p2= array2: [[Array]] - array to be inserted |Parameter 2=
|descr= Inserts the elements of one array into another, at a specified index. Neither arrays are touched by reference, a new array is returned.


|p3= index: [[Number]] - insertion index |Parameter 3=
|s1= [array1, array2, index] call [[BIS_fnc_arrayInsert]]


| [[Array]] - a new array |Return value=
|p1= array1: [[Array]] - array to insert into
____________________________________________________________________________________________


|x1= <code>_result = [<nowiki/>[0,1,2,3,4], ["a","b","c"], 1] [[call]] [[BIS_fnc_arrayInsert]]; {{codecomment|// returns [0,"a","b","c",1,2,3,4]}}</code> |Example 1=
|p2= array2: [[Array]] - array to be inserted
____________________________________________________________________________________________


| |See also=
|p3= index: [[Number]] - insertion index
}}


<h3 style="display:none">Notes</h3>
|r1= [[Array]] - a new array
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|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>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso=
[[Category:Function Group: Arrays|{{uc:arrayInsert}}]]
}}
[[Category:Functions|{{uc:arrayInsert}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:arrayInsert}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:arrayInsert}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:arrayInsert}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:arrayInsert}}]]

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