pushBackUnique: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " \| *(([^=\| ]+)('''|\[\[)([^=\| ]+)) * +\|p1=" to " |s1= $1 |p1=")
m (Text replacement - " \|p[0-9]{1,2}=([^ ]+) + \| *(\[\[Numb.+) * " to " |p$1=$2 |r1=$3 ")
Line 14: Line 14:
|p1= array: [[Array]]
|p1= array: [[Array]]


|p2= element: [[Anything]]
|p element: [[Anything]]=[[Number]] - index of inserted element or -1


| [[Number]] - index of inserted element or -1
|r1=
|x1= <code>_arr = [1,2,3];
|x1= <code>_arr = [1,2,3];

Revision as of 04:39, 13 June 2021

Hover & click on the images for description

Description

Description:
Description needed
Groups:
Arrays

Syntax

Syntax:
array pushBackUnique element
Parameters:
array: Array
Return Value:
Return value needed

Examples

Example 1:
_arr = [1,2,3]; _index = _arr pushBackUnique 3; hint str [_index, _arr]; //[-1,[1,2,3]]
Example 2:
_arr = [1,2,3]; _index = _arr pushBackUnique 4; hint str [_index, _arr]; //[3,[1,2,3,4]]

Additional Information

See also:
pushBackselectsetresizereversecountfindinforEachdeleteAtdeleteRangeappendsortarrayIntersectapplyBIS_fnc_arrayPushStackBIS_fnc_arrayPush

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