BIS fnc randomIndex: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (copy paste error)
(Page filling)
Line 1: Line 1:
{{Function|= Comments
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________
Line 8: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <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_randomIndex
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]] |= Parameter 1


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


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


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



Revision as of 13:27, 27 April 2018

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