Open jusTcrmp opened 2 years ago
I had to look up the source code as I forgot what it even does, and there are no examples either, sorry!
JSON_ArrayAppend
takes three arguments, the first is an object node ID, the second is a key within that object which contains an array node and the third is another node to push into that array (not concatenate).
So it would look something like this I think:
new Node:arr = JSON_Array(
JSON_Int(1),
JSON_Int(2)
);
new Node:a = JSON_Object(
"key1", arr
);
JSON_ArrayAppend(a, "key1", JSON_Int(3));
// { "key1": [ 1, 2, 3 ] }
thank you
i think you can add this to json.inc
Hello! Can you give me example for function JSON_ArrayAppend?
i need to make this json: {"items": [{"index": 0, "name": "Nissan GT-R"}, {"index": 1, "name": "Cadillac Escalade"}]}
buy i dont know how i can add objects to array with cycle