Xbrowse can read Jason... but I can not ...

Xbrowse can read Jason... but I can not ...

Postby Marc Venken » Tue Oct 04, 2022 2:30 pm

More the once I tried to read a jason code from a API request. No problem if the Jason of Hash (not always clear for me) has only simple Header and value.
Reading become difficult when there are complex strings inside the Jason.

Xbrowse can read the initial data, but also the more complex one because xbrowse will cal a new xbrowse and voila... the more deeper headers and data will show.

Otto had a simular topic, but it ended with "almost done..."

The functions for hashes did not give me the solution.

Can someone post the solution to grap all the data that are deeper inside the code ?

I want the 400 value as a variable :

MsgRun( cLink, "READING FORUM PAGE", { || uResponse := WebPageContents( cLink, .t. ) } )

uResponse = substr(uResponse,1,len(uResponse)-1)
hb_JsonDecode( uResponse, @hDatos ) // -> Hash

nOfferte = hDatos["isQuotation"] // to hash

All the hDatos single headers I can get and read, but not the complex ones

I saw a sample in a other program language doing something like : nOfferte = hDatos["isQuotation"] ["Second header"]
The solution is not needed from insite Xbrowse, a function that extract is ok.

Otto, Did you solve you Topic for the same thing? I also need to save to DBF, but need for HW and not the system that you use be now.








Image
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1424
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse can read Jason... but I can not ...

Postby nageswaragunupudi » Tue Oct 04, 2022 6:17 pm

For Hashes containing nested hashes/arrays, use HashTree.

XBROWSER HashTree( hHash )
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10604
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 50 guests