util.JSONArray.toFGL

Fills a dynamic array variable with the elements contained in the JSON array object.

Syntax

util.JSONArray.toFGL(
   dest DYNAMIC ARRAY )
  1. dest is the array variable to be set with values of the JSON string.
    Important: The dest is a dynamic array passed by reference to the method.

Usage

The toFGL() method fills the DYNAMIC ARRAY passed as parameter with the corresponding values defined in the JSON array object.

The destination array must have the same structure as the JSON source data. For more details see JSON to Genero BDL conversion rules.

Example

IMPORT util
MAIN
    DEFINE ja util.JSONArray
    DEFINE arr DYNAMIC ARRAY OF STRING
    LET ja = util.JSONArray.parse('["aa","bb","cc"]')
    CALL ja.toFGL(arr)
    DISPLAY arr[2] -- bb
END MAIN