I use a the Chilkat ActiveX control for many things. The Json part of the
control is free for use.
http://chilkatsoft.com/
He has VFP examples on the website. And the times I've had problems, he was
quick to respond.
LOCAL loArray as Chilkat_v9_5_0.IChilkatJsonArray
LOCAL loObject as Chilkat_v9_5_0.IChilkatJsonObject
loObject = CreateObject('Chilkat_9_5_0.JsonObject')
json = CHRTRAN('{\"code\":\" ERROR\",\"message\":\"Message
\",\"errors\":[{\"field1\":\"FIELD\",\"value\":\"VALUE\"}]}',"\","")
?'--'
loObject.load(json)
?loObject.stringof("code")
loArray = loObject.arrayof("errors")
?loArray.ObjectAt(0).StringOf("field1")
?loArray.ObjectAt(0).StringOf("value")
?loObject.emit()
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Paul
Newton
Sent: Friday, November 16, 2018 8:56 AM
To: [email protected]
Subject: RE: JSON for Visual FoxPro
Alan
The problem occurred when I was working in .NET - hence the need for
escaping the double quotes
Paul
-----Original Message-----
From: ProfoxTech [mailto:[email protected]] On Behalf Of Alan
Bourke
Sent: 16 November 2018 13:45
To: [email protected]
Subject: Re: JSON for Visual FoxPro
Sent by an external sender
------------------------------
TBF I don't think all those double quotes should be escaped anyway. IIRC
it's only if you're including string data and the string data has double
quotes in it.
{
"string1":"This value legitimately contains \"some quotes\""} }
--
Alan Bourke
alanpbourke (at) fastmail (dot) fm
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.