Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

%JSON_ObjectGetArray function


Function

Get array in field from JSON object.

Declaration


Blok kódu
languageesl
themeConfluence
INT %JSON_ObjectGetArray(
    INT in handle, 
    TEXT in field
 )


Parameters


handleHandle to parent JSON object.
fieldField name


Return value
Handle to JSON array, must be released by %JSON_FreeArrayHandle.


Description

Funcion get array in field from JSON object.

Exception is thrown if object at index is not array, handle to JSON object is invalid or field does not exists.

Example


Blok kódu
languageesl
themeRDark
 INT _obj
 _obj := %JSON_ObjectFromString('{"Array":[1,2,3]}')
 
 INT _arr
 _arr := %JSON_ObjectGetArray(_obj, "Array")

 %JSON_FreeObjectHandle(_obj)
 %JSON_FreeArrayHandle(_arr)