From Bohemia Interactive Community
Jump to navigation
Jump to search
Hover & click on the images for description
⚠
Only available in
Development branch(es) until its release with Arma 3 patch
v2.18.
Description
- Description:
- Serialise the passed data to JSON format.
- Groups:
- Strings
Syntax
- Syntax:
- toJSON data
- Parameters:
- data: can be one of:
- HashMap: JSON object
- Array: JSON array
- Number: JSON number (float)
- String: JSON string
- Boolean: JSON bool (true/false, not 1/0)
- nil: JSON null
⚠
The
nil value can only be passed as a member of
Array/
HashMap and cannot be passed directly as the command would simply not execute.
- Return Value:
- String - JSON result
Examples
- Example 1:
-
result:
["this","is","an","array"]
- Example 2:
-
result:
{"bKey":true,"sKey":"Hello there","oKey":null,"nkey":42,hKey:{"key1":"General Kenobi","key2":true,"yolo":"Hello it's me"}}
- Example 4:
Additional Information
- See also:
- fromJSON toString str
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