find: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
[[Category:Scripting Commands|FIND]]
{{Command|= Comments
[[Category:Scripting Commands ArmA|FIND]]
____________________________________________________________________________________________


| arma |= Game name


<h2 style="color:#000066">'''''array '' find  '' x'''''</h2>
|2.92|= Game version
____________________________________________________________________________________________


| Returns the position of the first array element that matches x, returns -1 if not found. |= Description
____________________________________________________________________________________________


'''Operand types:'''
| array '''find''' x |= Syntax


'''array''': [[Array]]
|p1= array [[Array]] |= Parameter 1


'''x''': [[Any Value]]
|p2= x [[Any Value]] |= Parameter 2


'''Type of returned value:'''
| [[Number]] |= Return value
____________________________________________________________________________________________
 
|x1= <pre>[0, 1, 2] find 1 .... result is 1</pre> |= Example 1
____________________________________________________________________________________________


[[Number]]
|  |= See also


'''Compatibility:'''
}}


Version 2.92 required.
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


'''Description:'''
<!-- Note Section END -->
 
</dl>
Returns the position of the first array element that matches x, returns -1 if not found.


 
<h3 style="display:none">Bottom Section</h3>
'''Example''':
[[Category:Scripting Commands|FIND]]
 
[[Category:Scripting Commands ArmA|FIND]]
[0, 1, 2] '''find''' 1 .... result is 1

Revision as of 01:09, 2 August 2006

-wrong parameter ("Arma") defined!-2.92
Hover & click on the images for description

Description

Description:
Returns the position of the first array element that matches x, returns -1 if not found.
Groups:
Uncategorised

Syntax

Syntax:
array find x
Parameters:
array Array
x Any Value
Return Value:
Number

Examples

Example 1:
[0, 1, 2] find 1 .... result is 1

Additional Information

See also:
See also needed

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