BIS fnc findInPairs: Difference between revisions
Jump to navigation
Jump to search
m (Text replacement - " it's" to " it is") |
m (page filled) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma3 | |game1= arma3 | ||
|0.76 | |version1= 0.76 | ||
| | <!--|serverExec= server--> | ||
<!--|arg= local--> | |||
<!--|eff= local--> | |||
|descr= Searches the associative array for the first occurance of the key string and returns its index. | |||
|s1= [array, key] call [[BIS_fnc_findInPairs]] | |||
| | |p1= array: [[Array]] - Array to search through | ||
| | |p2= key: [[String]] - Key to search for | ||
| | |r1= [[Number]] - Index of first occurence | ||
|x1= <code></code> | |x1= <code>[[["apple",3],["pear",2]],"apple"] [[call]] [[BIS_fnc_findInPairs]];{{cc|Returns 0}}</code> | ||
| [[ | |exec= call | ||
|seealso= [[find]] [[findIf]] | |||
}} | }} | ||
[[Category:Function Group: Arrays|{{uc:findInPairs}}]] | [[Category:Function Group: Arrays|{{uc:findInPairs}}]] | ||
[[Category:Functions|{{uc:findInPairs}}]] | [[Category:Functions|{{uc:findInPairs}}]] | ||
[[Category:{{Name|arma3}}: Functions|{{uc:findInPairs}}]] | [[Category:{{Name|arma3}}: Functions|{{uc:findInPairs}}]] |
Revision as of 09:25, 15 September 2020
Description
- Description:
- Searches the associative array for the first occurance of the key string and returns its index.
- Execution:
- call
- Groups:
- Uncategorised
Syntax
- Syntax:
- [array, key] call BIS_fnc_findInPairs
- Parameters:
- array: Array - Array to search through
- key: String - Key to search for
- Return Value:
- Number - Index of first occurence
Examples
- Example 1:
[[["apple",3],["pear",2]],"apple"] call BIS_fnc_findInPairs;// Returns 0
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