fromJSON: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page creation)
 
m (Fix bad copy/paste)
Line 26: Line 26:
|x1= <sqf>
|x1= <sqf>
private _myNumber = fromJSON "42"; // _myNumber is 42
private _myNumber = fromJSON "42"; // _myNumber is 42
private _myString = fromJSON """Hello there"""; // _myNumber is "Hello there"
private _myString = fromJSON """Hello there"""; // _myString is "Hello there"
private _myArray = fromJSON "[42, ""Hello there"", true]"; // _myArray is [42, "Hello there", true]
private _myArray = fromJSON "[42, ""Hello there"", true]"; // _myArray is [42, "Hello there", true]
</sqf>
</sqf>

Revision as of 17:33, 8 September 2024

Hover & click on the images for description
Only available in Development branch(es) until its release with Arma 3 patch v2.18.

Description

Description:
Obtain the game value from the provided JSON-formatted string.
Groups:
Strings

Syntax

Syntax:
fromJSON jsonValue
Parameters:
jsonValue: String - JSON data
Return Value:
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]

Additional Information

See also:
toJSON parseSimpleArray

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