BIS fnc arrayFindDeep: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - "\[\[Category\:Function Group\: Arrays(\|\{\{[a-zA-Z0-9_:]+\}\})?\]\]" to "") |
Lou Montana (talk | contribs) m (Text replacement - "_{10,} " to "") |
||
Line 1: | Line 1: | ||
{{Function|Comments= | {{Function|Comments= | ||
| arma2 |Game name= | | arma2 |Game name= | ||
Line 7: | Line 6: | ||
|gr1= Arrays|GROUP1= | |gr1= Arrays|GROUP1= | ||
| Searches an array for a specific value and returns its index.|Description= | | Searches an array for a specific value and returns its index.|Description= | ||
| [array,value] call [[BIS_fnc_arrayFindDeep]] |Syntax= | | [array,value] call [[BIS_fnc_arrayFindDeep]] |Syntax= | ||
Line 24: | Line 21: | ||
|exec= spawn |Execution= | |exec= spawn |Execution= | ||
---> | ---> | ||
|x1= <code>[ [1,2,3,4,5], 3 ] [[call]] [[BIS_fnc_arrayFindDeep]];//Returns [2]</code>|Example 1= | |x1= <code>[ [1,2,3,4,5], 3 ] [[call]] [[BIS_fnc_arrayFindDeep]];//Returns [2]</code>|Example 1= | ||
| [[BIS_fnc_addToPairs]], [[find]], [[select]], [[BIS_fnc_removeIndex]] |See also= | | [[BIS_fnc_addToPairs]], [[find]], [[select]], [[BIS_fnc_removeIndex]] |See also= |
Revision as of 22:38, 16 January 2021
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 wasn't found it returns -1
Examples
- Example 1:
[ [1,2,3,4,5], 3 ] call BIS_fnc_arrayFindDeep;//Returns [2]
Additional Information
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