Add name-array pair into JSON object
%JSON_ObjectSetArray( INT in handle, TEXT in field, INT in array )
None
Function adds name-array pair into JSON object. If field already exists, value is updated.
Exception is thrown if handle to parent JSON object or JSON array is invalid or field does not exists.
INT _obj _obj := %JSON_CreateObject() INT _arr _arr := %JSON_CreateArray() %JSON_ArrayAppendValue(_arr, 3.1416) %JSON_ObjectSetArray(_obj, "Constants", _arr) %JSON_FreeObjectHandle(_obj) %JSON_FreeArrayHandle(_arr)
Related pages:
JSON format manipulation functionsFunction arguments - types
0 komentárov