ResizeJSONElements()

Syntax

ResizeJSONElements(JSONValue, Size)
Description
Resize a JSON value of type #PB_JSON_Array so that it has the given number of elements.

Parameters

JSONValue The JSON value. The value must be of type #PB_JSON_Array.
Size The new size of the array. This specifies the total number of elements (not the index of the highest array element like Dim).

Return value

None.

Remarks

If new elements are added to the array, they will have the type #PB_JSON_Null.

Example

  ParseJSON(0, "[1, 2, 3, 4, 5]") 
  
  ResizeJSONElements(JSONValue(0), 3)
  Debug ComposeJSON(0)
  
  ResizeJSONElements(JSONValue(0), 10)
  Debug ComposeJSON(0)

See Also

SetJSONArray(), AddJSONElement(), RemoveJSONElement(), ClearJSONElements(), GetJSONElement(), JSONArraySize(), JSONType()

Supported OS

All

<- RemoveJSONMember() - Json Index - SaveJSON() ->