Hi DAW,
With references to:
https://www.example-code.com/datafle...ate_string.asp
Code:
Procedure Test
Handle hoJson
String sTemp1
// This example requires Chilkat v9.5.0.63 or greater.
Get Create (RefClass(cComChilkatJsonObject)) To hoJson
If (Not(IsComObjectCreated(hoJson))) Begin
Send CreateComObject of hoJson
End
// The UpdateString method updates or adds a string member.
// It also auto-creates the objects and/or arrays that
// are missing. For example:
Get ComUpdateString Of hoJson "test.abc[0].xyz" "Chicago Cubs" To iSuccess
End_Procedure
Are there plans to enhance the cJSONObject class to allow string paths as an input to auto-create/update values within a JSON object ?
Something like:
Code:
Get UpdateString of hoJson "message.subject" "Sample Email with Attachments" to bSuccess
Get UpdateString of hoJson "message.body.contentType" "Text" to bSuccess
Get UpdateString of hoJson "message.body.content" "This is the plain-text body..." to bSuccess
Get UpdateString of hoJson "message.toRecipients[0].emailAddress.name" "DAW Support" to bSuccess
Get UpdateString of hoJson "message.toRecipients[0].emailAddress.address" "support@dataflex.com" to bSuccess
"UpdateString" is probably quite a loose term - a better option would be variant values.
Thanks.