Arma 3 Scripting

Command in HashMap

getOrDefaultCall

Also available as Markdown and JSON, or read the original wiki page.

Description

Retrieves a value from the HashMap for the given 'key', executes given 'code' if key was not found and returns result. Additionally sets key to the code result value if set is true.

Syntax

hashMap getOrDefaultCall [key, code, set]

Parameters:

Returns: Anything

Examples

Example 1

_hashmap getOrDefaultCall [123, { systemChat "The key 123 does not exist and will be created and assigned 345"; 345 }, true];

See also

getOrDefault · HashMap · get