The JSONArray class / util.JSONArray methods |
Creates a new JSON array object from a DYNAMIC ARRAY.
util.JSONArray.fromFGL( source DYNAMIC ARRAY ) RETURNING array util.JSONArray
The util.JSONArray.fromFGL() method creates a new JSON array from the DYNAMIC ARRAY variable passed as parameter.
The new created object must be assigned to a program variable defined with the util.JSONArray type.
The members of the DYNAMIC ARRAY are converted to a list of name/value pairs in the JSON array object.
The dynamic array can be structured with a RECORD definition: the elements of the array will be converted individually.
For more details about FGL to JSON conversion, see FGL to JSON conversion rules.
IMPORT util MAIN DEFINE da DYNAMIC ARRAY OF INTEGER DEFINE arr util.JSONArray LET da[1] = 123 LET da[2] = 972 LET arr = util.JSONArray.fromFGL(da) DISPLAY arr.toString() END MAIN