BIS fnc conditionalSelect: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 53: | Line 53: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| |= See also | | [[select]] |= See also | ||
}} | }} | ||
Line 75: | Line 75: | ||
<dl class="command_description"> | <dl class="command_description"> | ||
<dd class="notedate">Posted on May 8, 2016 - 07:26 (UTC)</dd> | <dd class="notedate">Posted on May 8, 2016 - 07:26 (UTC)</dd> | ||
<dt class="note">[[User:AgentRevolution| | <dt class="note">[[User:AgentRevolution|AgentRev]]</dt> | ||
<dd class="note"> | <dd class="note"> | ||
Since Arma 3 v1.55, the [[select]] command can be used to make conditional selections just like this function. | Since Arma 3 v1.55, the [[select]] command can be used to make conditional selections just like this function. |
Revision as of 08:27, 8 May 2016
Description
- Description:
/************************************************************ Conditional Select Parameters: [array, {condition}] This returns a sub-array of elements that satisfy a specific condition. The originally passed array is NOT modified! The function takes, in order, every element of the passed array, evaluates it in the condition, and, if the condition is true, adds it to the return array. In the condition, the currently tested element is assigned to the variable "_x". Care must be taken that the condition won't cause errors. For example, if your condition assumes all elements are numbers, errors will occur if your array includes strings. This function is similar to the "count" command, only it returns the elements of the array that satisfy the condition, rather than simply returning the count. Example: [[10,0,8,2,6,4], {_x > 5}] call BIS_fnc_conditionalSelect Returns: [10,8,6] Example: [[10,true,8,player], {typename _x == "STRING"}] call BIS_fnc_conditionalSelect Returns: [] ************************************************************/
(Placeholder description extracted from the function header by BIS_fnc_exportFunctionsToWiki)- Execution:
- call
- Groups:
- Uncategorised
Syntax
- Syntax:
- Syntax needed
- Return Value:
- Return value needed
Examples
- Example 1:
Additional Information
- See also:
- select
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