BIS fnc randomIndex: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) (Page filling) |
m (template:command argument fix) |
||
Line 7: | Line 7: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Return a random integer representing an index in the passed array. |= | | Return a random integer representing an index in the passed array. |DESCRIPTION= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| array call [[BIS_fnc_randomIndex]] |= | | array call [[BIS_fnc_randomIndex]] |SYNTAX= | ||
|p1= array: [[Array]] of [[Anything]] |= | |p1= array: [[Array]] of [[Anything]] |PARAMETER1= | ||
| [[Number]] |= | | [[Number]] |RETURNVALUE= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|x1= <code>["a",0,objNull] [[call]] [[BIS_fnc_randomIndex]]; {{codecomment|// returns 0, 1 or 2}}</code> |= | |x1= <code>["a",0,objNull] [[call]] [[BIS_fnc_randomIndex]]; {{codecomment|// returns 0, 1 or 2}}</code> |EXAMPLE1= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| [[floor]], [[count]], [[random]], [[selectRandom]] |= | | [[floor]], [[count]], [[random]], [[selectRandom]] |SEEALSO= | ||
}} | }} | ||
Revision as of 14:32, 7 April 2019
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