for j = 0 to json2.Child("Persons").Count - 1
json1.Child("Persons").Append(json2.Child("Persons").Child(j))
next
… the “for” does run the expect number of times and there was no error… but the json1 “Person” array still has the same number of elements that it did before I ran the code.
Unless I have been looking at this too long “jsonItem.append” does not seem to able to append a jsonItem… Maybe a bug?
I’m not a big fan of long statements like this. My suggestion is to split it up with assignments so you can follow it easier in the debugger, something like this:
dim appendTo as JSONItem = json1.Child( "Persons" )
dim getFrom as JSONItem = json2.Child( "Persons" )
for j as integer = 0 to getFrom.Count - 1
dim appendItem as JSONItem = getFrom.Child( j )
appendTo.Append appendItem
next