BIS fnc arrayInsert: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Page filling - missing see also)
Line 1: Line 1:
{{Function|= Comments
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma2 |= Game name
| arma2 |Game name=


|1.00|= Game version
|1.00|Game version=
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>
| Inserts the elements of one array into another, at a specified index. Neither arrays are touched by reference, a new array is returned. |Description=
/************************************************************
____________________________________________________________________________________________
Array Insert


Parameters: [base array, insert array, index]
| [array1, array2, index] call [[BIS_fnc_arrayInsert]] |Syntax=
Returs: [array]


Inserts the elements of one array into another, at a specified
|p1= array1: [[Array]] - array to insert into |Parameter 1=
index.


Neither arrays are touched by reference, a new array is returned.
|p2= array2: [[Array]] - array to be inserted |Parameter 2=


Example: [[0,1,2,3,4], ["a","b","c"], 1] call BIS_fnc_arrayInsert
|p3= index: [[Number]] - insertion index |Parameter 3=
Returns: [0,"a","b","c",1,2,3,4]
************************************************************/


//extract parameters
| [[Array]] - a new array |Return value=
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_arrayInsert]]; --> |= Syntax
|x1= <code>_result = <nowiki>[</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=
 
|p1= |= Parameter 1
 
| |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=
| |See also=
____________________________________________________________________________________________
 
| |= See also
 
}}
}}



Revision as of 01:08, 29 May 2018

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:
Uncategorised

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:
_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

Notes

Bottom Section