arrayencode

Alex Tweedly alex at tweedly.net
Wed Jun 22 19:31:38 EDT 2022


On 22/06/2022 17:02, Richard Gaskin via use-livecode wrote:
> [ ... about using JSON ... ]
> But if you don't need interoperability, you wouldn't need to write a 
> parser, since LC includes a good one built into the engine.
>
> What did I miss?
>
The fact that Livecode's support for JSON is, hmmm, mediocre at best ??

The parser "built-in" seems to work fine in the IDE, but not on the server :

> <?lc
> set the errormode to inline
> put the version
>
> put "{'name':'asdf'}" into t
> replace "'" with quote in t
> put JSONtoarray(t) into tA
> put the keys of tA
>
fails with -

file "/home/alextwee/public_html/rampuk/tJSON.lc"
   row 7, col 5: Function: error in function handler (JSONtoarray)
   row 7, col 5: put: error in expression

(there's no mention of any platform restricitons in the dictionary).

I tried copying in the sample ode for wrapping JSONToArray around mergJSONDecode,
which then fails with "error in function handler mergJSONDecode.


(I must admit I encountered this a while ago, figured it was probably a temporary issue
so I replaced JSON by LSON, and forgot all about it.) This discussion prompted me to re-try it.

I can't believe this problem isn't causing widespread problems, so it's probably
something specific about me, or my on-rev account. If anyone has suggestions, I'll
try them; if not, I'll put it as a bug report into QCC see what happens.

Alex.



More information about the use-livecode mailing list