BIS fnc randomIndex: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
m (Text replacement - "|= Game version" to "|Game version=")
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Function|Comments=
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________


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


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


| <pre>
| Return a random integer representing an index in the passed array. |DESCRIPTION=
/************************************************************
Random Index
 
Parameters: array
 
This returns a random integer representing an index in the passed array.
 
Example: [1,2,3] call BIS_fnc_selectRandom
Returns: 0, 1, or 2
************************************************************/
 
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_randomIndex]]; --> |= Syntax
| array call [[BIS_fnc_randomIndex]] |SYNTAX=


|p1= |= Parameter 1
|p1= array: [[Array]] of [[Anything]] |PARAMETER1=


| |= Return value
| [[Number]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
|x1= <code>["a",0,objNull] [[call]] [[BIS_fnc_randomIndex]]; {{codecomment|// returns 0, 1 or 2}}</code> |EXAMPLE1=
____________________________________________________________________________________________
____________________________________________________________________________________________


| |= See also
| [[floor]], [[count]], [[random]], [[selectRandom]] |SEEALSO=
 
}}
}}



Revision as of 00:10, 31 August 2019

Hover & click on the images for description

Description

Description:
Return a random integer representing an index in the passed array.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
array call BIS_fnc_randomIndex
Parameters:
array: Array of Anything
Return Value:
Number

Examples

Example 1:
["a",0,objNull] call BIS_fnc_randomIndex; // returns 0, 1 or 2

Additional Information

See also:
floorcountrandomselectRandom

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