BIS fnc arrayFindDeep: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
m (Text replacement - ">\[ +(.*) *\] +(call|spawn)" to ">[$1] $2")
 
(38 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma2
____________________________________________________________________________________________
|version1= 1.00


| arma2 |= Game name
|game2= arma2oa
|version2= 1.50


|1.00|= Game version
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| <pre>
|game4= arma3
|version4= 0.50


//------------------
|gr1= Arrays
// 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
//------------------


|descr= Searches an array for a specific value and returns its index.


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|s1= [array,value] call [[BIS_fnc_arrayFindDeep]]
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_arrayFindDeep]]; --> |= Syntax
|p1= array: [[Array]] - array to be searched


|p1= |= Parameter 1
|p2= value [[Anything]] - value to be searched for


| |= Return value
|r1= [[Array]] - returns array with index of found element, if it was not found it returns -1
____________________________________________________________________________________________


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


|seealso= [[BIS_fnc_addToPairs]] [[find]] [[select]] [[BIS_fnc_removeIndex]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Arrays|{{uc:arrayFindDeep}}]]
[[Category:Functions|{{uc:arrayFindDeep}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:arrayFindDeep}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:arrayFindDeep}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:arrayFindDeep}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:arrayFindDeep}}]]

Latest revision as of 17:27, 8 November 2023

Hover & click on the images for description

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:
[[1,2,3,4,5], 3] call BIS_fnc_arrayFindDeep;//Returns [2]

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