util.JSONArray.toFGL

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

Syntax

util.JSONArray.toFGL(
   arrayRef dynamic-array-type )
  1. arrayRef is the array variable to be set with values of the JSON string.
    Important:

    The arrayRef is a dynamic array passed by reference to the method.

  2. dynamic-array-type is a DYNAMIC ARRAY OF ... type.

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 support.

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