BIS fnc randomIndex: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page filling)
m (template:command argument fix)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Return a random integer representing an index in the passed array. |= Description
| Return a random integer representing an index in the passed array. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| array call [[BIS_fnc_randomIndex]] |= Syntax
| array call [[BIS_fnc_randomIndex]] |SYNTAX=


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


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


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


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



Revision as of 14:32, 7 April 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