Array editing or Validate JSON string?
Terry Judd
terry.judd at unimelb.edu.au
Thu Nov 15 20:19:20 EST 2018
Hi Bill - I convert the JSON (jsonImport) to an array then use a treeview widget to display it. I then use an actionDoubleClick handler in the widget script to grab the appropriate array element and display it in an ask dialog. The value goes back into the array and I export the array back to JSON (jsonExport). Works well as long as the JSON elements don't contain large amounts of text - in which case you might need a custom dialog for displaying and editing the contents.
Terry...
On 16/11/2018 10:10 am, "use-livecode on behalf of William Prothero via use-livecode" <use-livecode-bounces at lists.runrev.com on behalf of 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
More information about the use-livecode
mailing list