BIS fnc arrayFindDeep: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\| *(arg|eff|mp|serverExec|gr[0-9]) *= *(.*) * *\|([^=]{12})" to "|$1=$2 |descr=$3") |
Lou Montana (talk | contribs) m (Text replacement - ">\[ +(.*) *\] +(call|spawn)" to ">[$1] $2") |
||
(13 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{RV|type=function | {{RV|type=function | ||
| arma2 | |game1= arma2 | ||
|1.00 | |version1= 1.00 | ||
|game2= arma2oa | |game2= arma2oa | ||
Line 17: | Line 17: | ||
|descr= Searches an array for a specific value and returns its index. | |descr= Searches an array for a specific value and returns its index. | ||
|s1=[array,value] call [[BIS_fnc_arrayFindDeep]] | |s1= [array,value] call [[BIS_fnc_arrayFindDeep]] | ||
|p1= array: [[Array]] - | |p1= array: [[Array]] - array to be searched | ||
|p2= value [[Anything]] - | |p2= value [[Anything]] - value to be searched for | ||
|r1= [[Array]] - | |r1= [[Array]] - returns array with index of found element, if it was not found it returns -1 | ||
|x1= < | |x1= <sqf>[[1,2,3,4,5], 3] call BIS_fnc_arrayFindDeep;//Returns [2]</sqf> | ||
|seealso= [[BIS_fnc_addToPairs]] | |seealso= [[BIS_fnc_addToPairs]] [[find]] [[select]] [[BIS_fnc_removeIndex]] | ||
}} | }} | ||
Latest revision as of 17:27, 8 November 2023
Description
- Description:
- Searches an array for a specific value and returns its index.
- Execution:
- call
- Groups:
- Arrays
Syntax
- Syntax:
- [array,value] call BIS_fnc_arrayFindDeep
- Parameters:
- array: Array - array to be searched
- value Anything - value to be searched for
- Return Value:
- Array - returns array with index of found element, if it was not found it returns -1
Examples
- Example 1:
Additional Information
- See also:
- BIS_fnc_addToPairs find select BIS_fnc_removeIndex
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