Found an issue in SpiderBasic ? Please report it here !
Dirk Geppert
 
Posts: 177
Joined: Fri Sep 22, 2017 7:02 am

Problems with ExtractJSONArray

by Dirk Geppert Tue May 05, 2020 12:02 pm

The following code works in pb as expected.
With spider the json is also recognized as an array, but cannot be extracted.

Am I doing something wrong?

Code: Select all
Define txt.s = ~"{\"Pins\":[\"Text_1\",\"Text_2\"],\"Status\":{\"Code\":\"Ok\"}}"
Define Dim Pins.s(0)
Define JsonID, jObj

JsonID = ParseJSON(#PB_Any, txt)

If JsonID
 
  jObj = GetJSONMember(JSONValue(JsonID), "Pins")
 
  Debug JSONType(jObj)
  Debug GetJSONString(jObj)
 
  If jObj
    ExtractJSONArray(jObj, Pins())
  EndIf
  FreeJSON(JsonID)
EndIf
 
Debug ArraySize(Pins())
Fred
Site Admin
 
Posts: 1298
Joined: Mon Feb 24, 2014 10:51 am

Re: Problems with ExtractJSONArray

by Fred Mon May 18, 2020 8:46 am

Moved for investigation
Return to Bugs Reports

Who is online

Users browsing this forum: No registered users and 2 guests