BIS fnc randomIndex: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page filling)
m (Text replacement - "|= Game version" to "|Game version=")
(3 intermediate revisions by 2 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=
____________________________________________________________________________________________
____________________________________________________________________________________________


| 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 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