createHashMapFromArray: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Some wiki formatting) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 22: | Line 22: | ||
|s2since= arma3 2.04 | |s2since= arma3 2.04 | ||
|p21= keys: [[Array]] | |p21= keys: [[Array]] of [[HashMapKey]]s | ||
|p22= values: [[Array]] | |p22= values: [[Array]] of [[Anything]] | ||
{{Feature|informative|Size of ''keys'' and size of ''values'' arrays do not need to be equal. Missing values will be filled with [[nil]].}} | {{Feature|informative|Size of ''keys'' and size of ''values'' arrays do not need to be equal. Missing values will be filled with [[nil]].}} | ||
Revision as of 15:19, 29 April 2023
Description
- Description:
- Creates a new HashMap and initializes it from a key-value pair array
- Groups:
- HashMapArrays
Syntax
- Syntax:
- createHashMapFromArray [[key1, value1], [key2, value2]]
- Parameters:
- key: HashMapKey
- value: Anything
- Return Value:
- HashMap
Alternative Syntax
- Syntax:
- keys createHashMapFromArray values
- Parameters:
- keys: Array of HashMapKeys
- values: Array of Anything
- Return Value:
- HashMap
Examples
- Example 1:
- createHashMapFromArray [["a", 1], ["b", 2], ["c", 3]];
- Example 2:
- [1, 2, 3, 4] createHashMapFromArray []; // returns [[1, <null>], [2, <null>], [4, <null>], [3, <null>]]
- Example 3:
- [1, 2, 3] createHashMapFromArray ["one", "two", "three", "four"]; // returns [[1, "one"], [2, "two"], [3, "three"]]
Additional Information
- See also:
- createHashMap
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