Everything else that doesn't fall into one of the other categories.
bbanelli
 
Posts: 96
Joined: Mon Jul 13, 2015 7:40 am

Easiest way to compare two structures?

by bbanelli Wed Jan 03, 2018 10:34 pm

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.
"If you lie to the compiler, it will get its revenge."
Henry Spencer
http://www.pci-z.com/
Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest