%JSON_CreateArray function


Function

Creates a new empty JSON array.

Declaration
INT %JSON_CreateArray()
Parameters

None

Return value

Handler to JSON array, must be released by %JSON_FreeArrayHandle.

Description

Function creates a new empty JSON array. Array is indexed from 1.

Example
 INT _arr
 _arr := %JSON_CreateArray()
 
 BOOL _ret
 _ret := %JSON_ArrayAppendValue(_arr, 123)
 _ret := %JSON_ArrayAppendValue(_arr, 3.14)
 
 TEXT _txt
 _txt := %JSON_ArrayToString(_arr, @TRUE)
;_txt = "[123,3.14]"
Napíšte komentár