Arma 3 Scripting

createHashMapFromArray

  • Arma 3 v2.02

Command · also in Arrays · Markdown · JSON · original wiki page

Description

Creates a new HashMap and initializes it from a key-value pair array

Syntax

Syntax 1

createHashMapFromArray [[key1, value1], [key2, value2], ...]

Parameters:

Returns: HashMap

Syntax 2

since arma3 2.04

keys createHashMapFromArray values

Parameters:

Returns: 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"]]

See also

createHashMap