Resizes a JSON array. If the specified size is lower than the actual size, the last elements of the JSON array are removed. If the specified size is higher than the actual size, empty elements are added to the end of the JSON array.
Json.bdh
JsonArrayResize( in handle : number, in size : number ): boolean;
Parameter | Description |
---|---|
handle | Valid handle to a JSON array |
size | The new size of the JSON array |
transaction TMain var jsonText : string; jsonArray : number; begin jsonArray := JsonParse("[0,1,2,3,4]"); JsonArrayResize(jsonArray, 2); JsonToText(jsonArray, jsonText); Print("resized array: " + jsonText); JsonArrayResize(jsonArray, 4); JsonToText(jsonArray, jsonText); Print("resized array: " + jsonText); JsonFree(jsonArray); end TMain;
resized array: [0,1] resized array: [0,1,null,null]