%JSON_ArrayGetArray function


Function

Get array at index from JSON array.

Declaration
INT %JSON_ArrayGetArray(
    INT in handle, 
    INT in index
 )
Parameters
handleHandle to parent JSON array.
indexIndex of array
Return value
Handle to JSON array, must be released by %JSON_FreeArrayHandle.


Description

Funcion get array at index from JSON array.

Exception is thrown if object at index is not array, handle to JSON array is invalid or index is out of range.

Example
 INT _arr
 _arr := %JSON_ArrayFromString('[[1,2,3],[4,5,6]]')
 
 INT _tmp
 _tmp := %JSON_ArrayGetArray(_arr, 1)

 %JSON_FreeArrayHandle(_tmp)
 %JSON_FreeArrayHandle(_arr)
Napíšte komentár