PxPlus User Forum

Twitter Twitter Twitter

Author Topic: JSON - now array in V16?  (Read 1209 times)

Cedric

  • Silver Member
  • ***
  • Posts: 25
    • View Profile
JSON - now array in V16?
« on: September 20, 2020, 10:28:16 AM »
Hey guys,

I'm struggling with JSON strings!  PxPLus has changed something at some point and the format is now different causing my third party applications (mobile app and website) to not work with this newer Pxplus version.

Here's a simple code:

test$["44451"]="dfgdfgd"
test$["66662"]="tttteeee"
print Dim(List test${ALL})            


In PxPLus V15 or lower it returns:
{"44451":"dfgdfgd","66662":"tttteeee"}

In PxPLus V16 or Higher, it returns:
["dfgdfgd","tttteeee"]


Evertime the key is a number, it does that!?  This is causing big issues as we use JSONs a lot to send structured data.  I have patched a few of my critical functions to add some special characters in front of the key to remove it after the Json string generation.  But this requires me to revise all my programs which is far from ideal!

Is there a fix for this?




Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: JSON - now array in V16?
« Reply #1 on: September 21, 2020, 06:15:39 PM »
The JSON engine was changed to better handle arrays, however we kept the old version around.

To access the old version simply issue: 

SET_PARAM 'JV'=0
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

Cedric

  • Silver Member
  • ***
  • Posts: 25
    • View Profile
Re: JSON - now array in V16?
« Reply #2 on: September 22, 2020, 06:29:24 PM »
Cool!  That works!  Thanks!