merge JsonArrays

Posted by jmls on 08-Sep-2013 15:02

openedge 11.3

Let's say that I have 2 json arrays, J1 and J2

I now want to create a new JsonArray (J3) containing both J1 and J2 at a single level

is there a shorthand way of merging the two without having to loop through all the elements of J1 and J2 ?

All Replies

Posted by Peter Judge on 16-Sep-2013 14:02

jmls wrote:

openedge 11.3

Let's say that I have 2 json arrays, J1 and J2

I now want to create a new JsonArray (J3) containing both J1 and J2 at a single level

is there a shorthand way of merging the two without having to loop through all the elements of J1 and J2 ?

How does the following code work for you:

J3= new JsonArray().

J3:Add(J1).

J3:Add(J2).


There may be iteration happening under the covers but it's not in your code

Update: it won't work for you because they're on 2 levels. sorry.

-- peter

This thread is closed