News:

  • April 15, 2026, 07:40:28 PM

Login with username, password and session length

Author Topic: JSON Parse  (Read 5223 times)

JeffS

  • Hero Member
  • *****
  • Posts: 113
JSON Parse
« on: August 14, 2020, 04:28:31 PM »
I saw today that not all parameters in a JSONPARSE are updated when doing a replace or swap.  The "Found Value Numeric/Bit" parameter is the one I noticed didn't move correctly.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3803
    • Host Engineering
Re: JSON Parse
« Reply #1 on: August 14, 2020, 05:16:45 PM »
I could not duplicate it.  In a new project, I did a new JSONPARSE, changed the Found Value to Numeric/Bit, it sets it to D1028 (Return Results is D1030):
JSONPARSE SS0 DST511 1 0x100 """Name""" DST511 SS0 SS0 DST511 1 DST511 D1028 D1030

I did a Replace of D1028 with D2000 and it worked:
JSONPARSE SS0 DST511 1 0x100 """Name""" DST511 SS0 SS0 DST511 1 DST511 D2000 D1030

That doesn't mean there isn't an issue, it could just mean I could not duplicate it doing the steps above (e.g. may be a combination of your specific parameters).

Please provide the steps where you can duplicate it in a New project.  If you can't duplicate it in a New project, that may point to a different issue (let us know).





JeffS

  • Hero Member
  • *****
  • Posts: 113
Re: JSON Parse
« Reply #2 on: August 14, 2020, 06:29:32 PM »
In my case I was using a V memory and within the code block I use several V's as pointers, but not the same V memory as in the JSONPARSE. 

JeffS

  • Hero Member
  • *****
  • Posts: 113
Re: JSON Parse
« Reply #3 on: August 26, 2020, 10:08:43 AM »
So I wasn't able to reproduce this in a blank project. 

These are the steps where this showed up: I had a block of code containing the JSONPARSE and I copied it out into a new project so that I could format it to be copied into several other projects.  In this new project I then expanded the standard memory ranges in this project and moved all memory used in the copied code into this new range so that I ran no risk of using a memory range that was already being used in another program.  I was using the replace/swap function to do this and it is where the problem showed.  The only instruction that had issue was the JSONPARSE where the swap/replace moved the documentation but did not change the memory in this instruction.  This occurred in several code blocks that had been copied over containing JSONPARSE commands.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3803
    • Host Engineering
Re: JSON Parse
« Reply #4 on: August 26, 2020, 10:27:12 AM »
The only instruction that had issue was the JSONPARSE where the swap/replace moved the documentation but did not change the memory in this instruction.  This occurred in several code blocks that had been copied over containing JSONPARSE commands.

When you duplicate it, can you paste the JSONPARSE instruction here.  Just do Ctrl+C in Designer on that specific JSONPARSE instruction, and then paste it into your forum post - remove the sysconfig, memconfig, and documentation sections.  Then provide the exact replace/swap settings that fail.