arrayToJSON on lc server

Ralph DiMola rdimola at evergreeninfo.net
Tue Oct 17 11:24:21 EDT 2023


I've been using fastJson. I do a "start using" to include it as a library. To date I have not had any problems encoding an LC array to JSON and decoding it to a JavaScript array on the client browser.

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net

-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf Of Mike Kerner via use-livecode
Sent: Monday, October 16, 2023 11:03 PM
To: How to use LiveCode
Cc: Mike Kerner
Subject: Re: arrayToJSON on lc server

let's see: in the public repo, there's the json.lcb source:
https://github.com/livecode/livecode/blob/4606a10ea10b16d5071d0f9f263ccdd7ede8b31d/extensions/libraries/json/json.lcb#L4
also, references to the "fastjson" library:
https://github.com/bhall2001/fastjson

On Mon, Oct 16, 2023 at 10:49 PM Mike Kerner <MikeKerner at roadrunner.com>
wrote:

> the externalfunctions doesn't seem to be returning anything for a 
> project i just opened (never tested it, before). that project has a 
> lot of standalone inclusions, some of which have external functions, 
> so i don't know if it means externals that are directly attached to 
> the stack (like old xcmd's/xfcn's).
> grasping at straws, because i'm not deploying to lc server on linux
> * i assume you manually included mergjson in your standalone (assuming 
> you're building your project). if not, try that.
> * have you tried embedding the source from the 
> mergJSONLibrary.livecodescript into your main stack and then stepping 
> through the code? it's available in the oss repo or any of the forks 
> of that repo. that's just the library, not the mergjsonencode 
> external, but it might get you closer.
> * if that doesn't work, there are at least two other oss lc json 
> codebases, the most popular being mark smith's, which, i think, is 
> what monte used when he wrote mergjson.
>
> On Mon, Oct 16, 2023 at 7:21 PM Neville Smythe via use-livecode < 
> use-livecode at lists.runrev.com> wrote:
>
>> I am having a problem with the function arrayToJSON on LC Server 
>> 9.6.10 pro (Linux host) (I couldn't get it to work on earlier 
>> versions either)
>>
>> I get the error
>>
>> Function: error in function handler (arrayToJSON) The mergJSON.so 
>> file is in the Externals folder, which resides in the same directory 
>> as livecode-server. Since revdb calls work, which I assume use the 
>> revdb.so library, evidently Externals are loading, and permissions 
>> for mergJSON.so are the same as for revdb.so.
>>
>> This is supposed to work out of the box, so I must be missing 
>> something obvious.
>>
>> BTW, the call "the externalFunctions of this stack" return empty - is 
>> that correct, should it not return the functions available in the 
>> Externals .so libraries?
>>
>> Neville Smythe
>>
>>
>>
>>
>> _______________________________________________
>> 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
>>
>
>
> --
> On the first day, God created the heavens and the Earth On the second 
> day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>    and did a little diving.
> And God said, "This is good."
>


--
On the first day, God created the heavens and the Earth On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
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