BIS fnc consolidateArray: Difference between revisions
Jump to navigation
Jump to search
Killzone Kid (talk | contribs) (docs) |
m (template:command argument fix) |
||
Line 8: | Line 8: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
|Finds duplicities in the given array of anything and consolidates them into an array of sub-arrays |= | |Finds duplicities in the given array of anything and consolidates them into an array of sub-arrays |DESCRIPTION= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| array call [[BIS_fnc_consolidateArray]] |= | | array call [[BIS_fnc_consolidateArray]] |SYNTAX= | ||
|p1= array: [[Array]] - array of anything |= Parameter 1 | |p1= array: [[Array]] - array of anything |= Parameter 1 | ||
Line 17: | Line 17: | ||
| [[Array]] - array of sub-arrays in format <nowiki>[</nowiki>[value, count],...], where: | | [[Array]] - array of sub-arrays in format <nowiki>[</nowiki>[value, count],...], where: | ||
* value: [[Anything]] - consolidated element | * value: [[Anything]] - consolidated element | ||
* count: [[Number]] - occurrence count|= | * count: [[Number]] - occurrence count|RETURNVALUE= | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
Line 25: | Line 25: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| |= | | |SEEALSO= | ||
}} | }} |
Revision as of 11:26, 7 April 2019
Description
- Description:
- Finds duplicities in the given array of anything and consolidates them into an array of sub-arrays
- Execution:
- call
- Groups:
- Uncategorised
Syntax
- Syntax:
- array call BIS_fnc_consolidateArray
- Parameters:
- array: Array - array of anything
- Return Value:
- Array - array of sub-arrays in format [[value, count],...], where:
Examples
- Example 1:
["apple","apple","pear","pear","apple"] call BIS_fnc_consolidateArray; // Return: [["apple",3],["pear",2]]
- Example 2:
["apple","apple",1,1,nil,nil] call BIS_fnc_consolidateArray; // Return: [["apple",2],[1,2],[any,2]]
Additional Information
- See also:
- See also needed
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