Arma 3 Scripting

fromJSON

  • Arma 3 v2.18

Command · Markdown · JSON · original wiki page

Description

Obtain the game value from the provided JSON-formatted string.

Syntax

fromJSON jsonValue

Parameters:

Returns: Can be one of:

Examples

Example 1

private _myNumber = fromJSON "42";                                            // _myNumber is 42
private _myString = fromJSON """Hello there""";                                // _myString is "Hello there"
private _myArray = fromJSON "[42, ""Hello there"", true]";                    // _myArray is [42, "Hello there", true]
private _myHash = fromJSON "{""key1"": ""value1"", ""key2"": ""value2""}"    // _myHash is [["key2", "value2"], ["key1", "value1"]]

// Important: [] indicates array, {} and : indicates hash

See also

toJSON · parseSimpleArray