util.JSONArray.toFGL()

 

util.JSONArray.toFGL()fills a DYNAMIC ARRAY with the elements of the JSON array.

 

Syntax:

 

util.JSONArray.toFGL(destination)

 

Parameters:

 

destination

a DYNAMIC ARRAY variable that will be filled with the elements of the JSON array

 

destination is passed by reference to the method.

 

 

Usage and examples:

 

util.JSONArray.fromFGL() populates the DYNAMIC ARRAY passed as a parameter with the values included in the JSON array.

 

destination array must have the same structure as the source JSON array.

 

example code

MAIN

  DEFINE json_arr util.JSONArray

    DEFINE da DYNAMIC ARRAY OF STRING

    LET json_arr = util.JSONArray.parse('["aa","bb","cc"]')

    CALL json_arr.toFGL(da)

    DISPLAY da

  CALL fgl_getkey()  

END MAIN

 

obtained results

 

 

For greater details on how JSON strings are converted into fgl data types, refer here.

 

 

Example programs:

CVS server: client.querix.com

CVS repository: /lycia_doc_examples

User: client

Project: auxiliary_features/json

Program: util_JSONArray_toFGL

 

Related articles:

util.JSONArray.toString()