The JSONArray class / util.JSONArray methods |
Parses a JSON string and creates a JSON array object from it.
util.JSONArray.parse( source STRING ) RETURNING result util.JSONArray
The util.JSONArray.parse() method scans the JSON source string passed as parameter and creates a new JSON array object from it.
The new created object must be assigned to a program variable defined with the util.JSONArray type.
The source string must follow the JSON format specification. Elements of the list can contain multi-level structured data, but the string must follow the JSON array string syntax '[ element, ... ]' with square braces.
The method raises error -8109 if the JSON source string is not properly formatted.
IMPORT util MAIN DEFINE da DYNAMIC ARRAY OF INTEGER DEFINE arr util.JSONArray LET arr = util.JSONArray.parse("[1,2,3,4,5]") DISPLAY arr.toString() END MAIN