Page 1 of 1

Easiest way to compare two structures?

Posted: Wed Jan 03, 2018 10:34 pm
by bbanelli
Consider the following code:

Code: Select all

Structure sec
  Array a.i(4)
  Array b.i(4)
  Array c.i(4)
  Array d.i(4)
EndStructure

Define s.sec, x.sec

a$ = ~"{\"a\":[2,0,0,0],\"b\":[0,0,2,0],\"c\":[1,1,0,0],\"d\":[2,0,0,0]}"

ParseJSON(0, a$)
ExtractJSONStructure(JSONValue(0), @s.sec, sec)
FreeJSON(0)

ParseJSON(0, a$)
ExtractJSONStructure(JSONValue(0), @x.sec, sec)
FreeJSON(0)
What would be the easiest way to confirm those two structures contain that same date? Except iterating through each element and comparing, of course.