BIS fnc arrayFindDeep: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
m (pf)
Line 1: Line 1:
 
{{Function|Comments=
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________


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


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


| <pre>
| Searches an array for a specific value and returns its index.|Description=
____________________________________________________________________________________________


//------------------
| [array,value] call [[BIS_fnc_arrayFindDeep]] |Syntax=
// Purpose: This function searches an element in an array and returns the first occurence
// Arguments: [array, element]
// Return: anything
//
// Revision History:
// 24/11/06 0.1 - First cut
//------------------




</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|p1= array: [[Array]] - Array to be searched |Parameter 1=
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_arrayFindDeep]]; --> |= Syntax
|p2= value [[Anything]] - Value to be searched for|Parameter 2=


|p1= |= Parameter 1
| [[Array]] - Returns array with index of found element, if it wasn't found it returns -1 |Return value=


| |= Return value
<!---
|exec= spawn |= Execution
--->
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
|x1= <code>[ [1,2,3,4,5], 3 ] [[call]] [[BIS_fnc_arrayFindDeep]];//Returns [2]</code>|Example 1=
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[BIS_fnc_addToPairs]], [[find]], [[select]], [[BIS_fnc_removeIndex]] |See also=
}}


}}


<h3 style="display:none">Notes</h3>
<h3 style="display:none">Notes</h3>

Revision as of 22:43, 18 June 2018

Hover & click on the images for description

Description

Description:
Searches an array for a specific value and returns its index.
Execution:
call
Groups:
Uncategorised

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

See also:
BIS_fnc_addToPairsfindselectBIS_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


Notes

Bottom Section