First… thank you for the new 2021 release… looking forward to dig into it.
I just have a question… it seems that updating JSONItems no longer updates similar to how its does in 2020. Here is some code to illustrate what I mean…
Dim a As new JSONItem("{"“obj”":{"“a”":1}}")
Dim b As JSONItem = a.Child(“obj”)
b.Value(“a”) = 2
MsgBox Str(a.Child(“obj”).Value(“a”))
In Xojo 2020 the MsgBox outputs 2, but in Xojo 2021, it outputs 1.
Is this by design, or a bug?
If this is by design, would there be any workarounds so that I can assign part of the JSON to a separate variable by reference, and make assignments that still also updates the original variable?
One of our projects relies heavily on the ability to do this.
It is interesting to note that this bug is related to the object only, it is not present if you have an object vector.
In that case the modification is successful
IE:
{“obj”:{“a”:“test”}, “vo”:[{“a”:"test1}, {“a”:“test2”}]}
var j as new jsonItem()
j.child(“obj”).value(“a”)=“newTest”
=>to string is the same
j.child(“vo”).childAt(0).value(“a”)=“newTest1”
=>to string shows the updated jsonString