Array editing or Validate JSON string?

Mark Talluto mark at canelasoftware.com
Mon Nov 19 12:05:22 EST 2018


I always appreciate error reporting. I ran into the same problem. Sometimes you can see the error easily enough. But, in complex arrays, it is harder to see the error when looking at JSON. For this reason, I find dropping it into a validator to be useful. They can point you in the right direction to fix the JSON.

But, if you are trying to pick up on this programmatically in an app, the best you can do is check for success or failure by looking for data in the array. If it is not there, an error took place.


Best regards,

Mark Talluto
livecloud.io <http://livecloud.io/>
nursenotes.net <http://nursenotes.net/>
canelasoftware.com <http://www.canelasoftware.com/>




> On Nov 17, 2018, at 3:39 PM, William Prothero via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Folks:
> I guess I could have been more clear. I am editing the JSON directly in a text field. If I make a mistake, then use JSONToArray, the program just fails silently. What I would like to do is get a dialog that the JSON wasn’t formed correctly. Of course, since I’m using it for my personal development of my app, I can know that it failed if I don’t get the answer dialog I put in after it. but, it seems a kludge. Shouldn’t there be some kind of an error result if the JSON is ill-formed?
> Best,
> Bill
> 
>> On Nov 16, 2018, at 1:57 PM, Mark Talluto via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> Hi Bill,
>> 
>> My favorite JSON validator is:  https://jsonformatter.curiousconcept.com <https://jsonformatter.curiousconcept.com/>
>> 
>> 
>> Best regards,
>> 
>> Mark Talluto
>> livecloud.io <http://livecloud.io/>
>> nursenotes.net <http://nursenotes.net/>
>> canelasoftware.com <http://www.canelasoftware.com/>
>> 
>> 
>> 
>> 
>>> On Nov 15, 2018, at 3:09 PM, William Prothero via use-livecode <use-livecode at lists.runrev.com> wrote:
>>> 
>>> Hi, I’m editing a json string (for development uses) and wonder if there is an easy way to validate whether the string is a valid JSON string. 
>>> 
>>> Or, perhaps there is an easier way to display and edit a pretty simple array.
>>> 
>>> Suggestions would be helpful. Currently, I convert the array to JSON, put it in a text field, then edit the text field. It would be convenient if it could trap editing errors I might make. The simple way seems to just throw an error and stop execution of the script.
>>> 
>>> Best,
>>> Bill
>>> 
>>> William A. Prothero
>>> http://earthlearningsolutions.org
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the Use-livecode mailing list