GetJSONElement()

Syntax

Result = GetJSONElement(JSONValue, Index)
Description
Return the JSON array element at the given 'Index' of a JSON value of type #PB_JSON_Array.

Parameters

JSONValue The JSON value. The value must be of type #PB_JSON_Array.
Index The index of the array element to return. The index must be between 0 and JSONArraySize() - 1.

Return value

The address of the JSON value at the specified array index. If the given 'Index' is out of range, the result is 0.

Example

  ParseJSON(0, "[1, 2, 3, 4, 5]")
    
  For i = 0 To JSONArraySize(JSONValue(0)) - 1
    Debug GetJSONInteger(GetJSONElement(JSONValue(0), i))
  Next i

See Also

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

Supported OS

All

<- GetJSONDouble() - Json Index - GetJSONFloat() ->