BIS fnc randomIndex: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma2 | | arma2 | ||
|1.00 | |1.00 | ||
|gr1= Arrays | |gr1= Arrays | ||
| Return a random integer representing an index in the passed array. | | Return a random integer representing an index in the passed array. | ||
| array call [[BIS_fnc_randomIndex]] | | array call [[BIS_fnc_randomIndex]] | ||
|p1= array: [[Array]] of [[Anything]] | |p1= array: [[Array]] of [[Anything]] | ||
| [[Number]] | | [[Number]] | ||
|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> | ||
| [[floor]], [[count]], [[random]], [[selectRandom]] | | [[floor]], [[count]], [[random]], [[selectRandom]] | ||
}} | }} | ||
Revision as of 23:41, 17 January 2021
Description
- Description:
- Return a random integer representing an index in the passed array.
- Execution:
- call
- Groups:
- Arrays
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