Re: arrayencode

2022-06-23 Thread Alex Tweedly via use-livecode
On 23/06/2022 17:48, Ralf Bitter via use-livecode wrote: Hi Alex, have you added the mergJSON External to your server installation? No. In fact, I didn't realize I needed to, or even could :-) You guessed it, use "load extension", example (tested on on-rev): load extension from file "/home

Re: arrayencode

2022-06-23 Thread Ralf Bitter via use-livecode
On 23.06.22 14:23, Alex Tweedly via use-livecode wrote: On 23/06/2022 10:31, Ralf Bitter via use-livecode wrote: Hi Alex, the JSONtoArray() function is part of the mergJSON external. The README of this external describes how to use this function and it's counterpart JSONtoArray as follows:

Re: arrayencode

2022-06-23 Thread Martin Koob via use-livecode
Hi There is a confirmed bug in bugzilla regarding loading of the mergJSON library. https://quality.livecode.com/show_bug.cgi?id=21223 I ran into it when building a standalone. I didn’t cause a problem in the IDE. In the standalone settings ‘Inclusions’ tab if I chose 'Search for required incl

Re: arrayencode

2022-06-23 Thread Alex Tweedly via use-livecode
On 23/06/2022 10:31, Ralf Bitter via use-livecode wrote: Hi Alex, the JSONtoArray() function is part of the mergJSON external. The README of this external describes how to use this function and it's counterpart JSONtoArray as follows: Thanks Ralf. I did see that code in the dictionary - but it

Re: arrayencode

2022-06-23 Thread Ralf Bitter via use-livecode
Hi Alex, the JSONtoArray() function is part of the mergJSON external. The README of this external describes how to use this function and it's counterpart JSONtoArray as follows: This external has been implemented to encode/decode UTF8 JSON to a LiveCode array as quickly as possible. Currently

Re: arrayencode

2022-06-22 Thread Richard Gaskin via use-livecode
Alex Tweedly wrote: > Nevertheless, my central point remains (afact) valid - the support > for JSON in Livecode seems incomplete, and in particular it seems > flaky/missing on LCServer. Making externals easily findable by the LC Server engine should be a quick fix for them, no? -- Richard Ga

Re: arrayencode

2022-06-22 Thread Alex Tweedly via use-livecode
On 23/06/2022 00:38, Richard Gaskin via use-livecode wrote: Interesting take. Thanks. I'd read Tom's post as being about LSON, with LC in both producer and consumer roles, which would make a JavaScript-optimized format unnecessary.  Perhaps I'd misunderstood. No, you didn't misunderstand. I

Re: arrayencode

2022-06-22 Thread Richard Gaskin via use-livecode
Alex Tweedly wrote: > 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 Livecod

Re: arrayencode

2022-06-22 Thread Alex Tweedly via use-livecode
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, med

Re: arrayencode

2022-06-22 Thread Bob Sneidar via use-livecode
via use-livecode > wrote: > > > What about storing to SQL blob and binary files? Will it suffice? I'd > > consider converting all my arrayEncoding to JSON if so. > > LSON (output from LC's built-in arrayEncode) is a binary format, so any > storage or transpor

Re: arrayencode

2022-06-22 Thread Richard Gaskin via use-livecode
Bob Sneidar wrote: > Richard I think I hear you say that JSON is an alternative to > arrayEncode? I'm apparently writing so badly maybe I should skip the shorthand "LSON" and just write the full form: "output from LC's built-in arrayEncode". I'd ad

Re: arrayencode

2022-06-22 Thread Richard Gaskin via use-livecode
Tom Glod wrote: > Hello Richard, thanks for the detailed answer. > There are 2 reasons why I am considering this. > > 1. I can skip the encoding and decoding from and to json. > 2. it supports binary, and does not require base encoding and its > 33% inflation. > > For interoperability for the use

Re: arrayencode

2022-06-22 Thread Bob Sneidar via use-livecode
Richard I think I hear you say that JSON is an alternative to arrayEncode? What about storing to SQL blob and binary files? Will it suffice? I'd consider converting all my arrayEncoding to JSON if so. Bob S > On Jun 21, 2022, at 19:43 , Richard Gaskin via use-livecode > wrot

Re: arrayencode

2022-06-22 Thread Tom Glod via use-livecode
opers can have access to it directly > > through LCB or is it accessible in the realm of the engine only. > > I haven't yet had occasion to use LC Builder in production, so I'm not > sure if that language also offers some form of LC Script's > arrayEncode/arrayDecode.

Re: arrayencode

2022-06-22 Thread Richard Gaskin via use-livecode
through LCB or is it accessible in the realm of the engine only. I haven't yet had occasion to use LC Builder in production, so I'm not sure if that language also offers some form of LC Script's arrayEncode/arrayDecode. Given how central arrays are to working in LC I'd be surp

Re: arrayencode

2022-06-22 Thread Martin Koob via use-livecode
Hi Richard Thanks for the explanation. I think it is a helpful term or distinction to have. I think it would be good to actually have that term with a formal definition published by LiveCode or the community with references to BSON so it will show up in web searches for either term to lead p

Re: arrayencode

2022-06-21 Thread Richard Gaskin via use-livecode
Martin Koob wrote: > What is LSON? A web search doesn’t turn up anything. A shot > in the dark here but Is it something internal to LiveCode i.e. > Livecode Script Object Notation that is the basis for LiveCode > arrays? Sorry, Martin. I need to get out more. I've been using LSON ("LiveCode

Re: arrayencode

2022-06-21 Thread Martin Koob via use-livecode
use-livecode > wrote: > > l oTom Glod wrote: > > > I am wondering if anyone here knows the encoding algorithm > > that arrayencode() uses? > > Yes. > > > > Is it one that can be implemented in another language or is > > it proprietary? > >

Re: arrayencode

2022-06-21 Thread Richard Gaskin via use-livecode
l oTom Glod wrote: > I am wondering if anyone here knows the encoding algorithm > that arrayencode() uses? Yes. > Is it one that can be implemented in another language or is > it proprietary? It should be technically possible to implement any algo in any sufficiently-compl

arrayencode

2022-06-21 Thread Tom Glod via use-livecode
Hi Folks, I am wondering if anyone here knows the encoding algorithm that arrayencode() uses? Is it one that can be implemented in another language or is it proprietary? Thanks, Tom ___ use-livecode mailing list use-livecode@lists.runrev.com Please

Re: ArrayEncode/Decode broken??

2022-03-19 Thread J. Landman Gay via use-livecode
On 3/19/22 3:27 PM, Bob Sneidar via use-livecode wrote: I’m so embarrassed. I was too but I caught myself before I hit the Send button. We get so used to LC reading our minds we're surprised when it doesn't. -- Jacqueline Landman Gay | jac...@hyperactivesw.com HyperActive Softwar

Re: ArrayEncode/Decode broken??

2022-03-19 Thread Bob Sneidar via use-livecode
th"] >> put field "fldInvFilePath" into tSettingsA ["invfilepath"] >> put field "fldOutFilePath" into tSettingsA ["Outfilepath"] >> put the dgText [true] of group "dgVariance" into tSettingsA ["gridtext"] >>

Re: ArrayEncode/Decode broken??

2022-03-18 Thread J. Landman Gay via use-livecode
ld "fldInvFilePath" into tSettingsA ["invfilepath"] put field "fldOutFilePath" into tSettingsA ["Outfilepath"] put the dgText [true] of group "dgVariance" into tSettingsA ["gridtext"] put arrayEncode(tSettingsA) into tSettin

ArrayEncode/Decode broken??

2022-03-18 Thread Bob Sneidar via use-livecode
put field "fldOutFilePath" into tSettingsA ["Outfilepath"] put the dgText [true] of group "dgVariance" into tSettingsA ["gridtext"] put arrayEncode(tSettingsA) into tSettingsText put the filename of this stack into tSettingsPath set the it

Re: LC7 arrayEncode/Decode

2015-05-04 Thread William Prothero
vecode-boun...@lists.runrev.com] On Behalf > Of William Prothero > Sent: Monday, May 04, 2015 2:43 PM > To: Use-livecode Use-livecode > Subject: Re: LC7 arrayEncode/Decode > > Richard: > You may be right about inconsistent formatting in the array. > I started the array with: >

RE: LC7 arrayEncode/Decode

2015-05-04 Thread Ralph DiMola
to:use-livecode-boun...@lists.runrev.com] On Behalf Of William Prothero Sent: Monday, May 04, 2015 2:43 PM To: Use-livecode Use-livecode Subject: Re: LC7 arrayEncode/Decode Richard: You may be right about inconsistent formatting in the array. I started the array with: put myVal into myArray[1][“name”

Re: LC7 arrayEncode/Decode

2015-05-04 Thread William Prothero
ll return the original array. > Best, > Bill > >> On May 3, 2015, at 2:39 PM, Richard Gaskin >> wrote: >> >> William Prothero wrote: >> >>> I found an oddity with arrayEncode and arrayDecode, When I saved an >>> array to a file, first using

Re: LC7 arrayEncode/Decode

2015-05-04 Thread William Prothero
integer. I did the fix and it worked fine. Still a bug? Seems it should still return the original array. Best, Bill > On May 3, 2015, at 2:39 PM, Richard Gaskin wrote: > > William Prothero wrote: > > > I found an oddity with arrayEncode and arrayDecode, When I saved an > >

Re: LC7 arrayEncode/Decode

2015-05-03 Thread Peter Haworth
x27;t need the base64 stuff - this is just for storing prefs data in a local file. However, for backwards compatibility purposes, I think I will leave it in place, especially since arrayEncode will handle any Unicode for me. Pete lcSQL Software <http://www.lcsql.com> Home of lcStackBrowser &

Re: LC7 arrayEncode/Decode

2015-05-03 Thread Richard Gaskin
William Prothero wrote: > I found an oddity with arrayEncode and arrayDecode, When I saved an > array to a file, first using arrayEncode(myArray), wrote it out as > > put arrayEncode(myArray) into theEncodedArray > put theEncodedArray into URL(“binfile:”&myfile) > >

Re: LC7 arrayEncode/Decode

2015-05-03 Thread Richard Gaskin
x27;s native array format accounts for Unicode. It can also encode for earlier versions with an optional second argument to the arrayEncode function to specify the desired output version (e.g. "6.7"). When decoding arrays, LC 7 automatically detects the version from the data and

Re: LC7 arrayEncode/Decode

2015-05-02 Thread Peter M. Brigham
if it = empty then exit to top put it into pSaveToWhere end if put base64encode(arrayEncode(pArray)) into tFileData put tFileData into url ("file:" & pSaveToWhere) if the result <> empty then -- an error occurred return "error while saving file:"

Re: LC7 arrayEncode/Decode

2015-05-02 Thread Peter Haworth
hero wrote: > I found an oddity with arrayEncode and arrayDecode, When I saved an array > to a file, first using arrayEncode(myArray), wrote it out as > > put arrayEncode(myArray) into theEncodedArray > put theEncodedArray into URL(“binfile:”&myfile) > > and th

Re: LC7 arrayEncode/Decode

2015-05-02 Thread Mark Talluto
On May 2, 2015, at 5:06 PM, William Prothero wrote: > This seems like a bug to me. I didn’t get any satisfaction when I set the > storage method as text, but then again, I couldn’t find a lesson where that > format was specified. But, it seems like whether it’s binary or not, it > should still

Re: LC7 arrayEncode/Decode

2015-05-02 Thread William Prothero
I found an oddity with arrayEncode and arrayDecode, When I saved an array to a file, first using arrayEncode(myArray), wrote it out as put arrayEncode(myArray) into theEncodedArray put theEncodedArray into URL(“binfile:”&myfile) and then read it back in using put URL(“binfile:”&myFi

Re: LC7 arrayEncode/Decode

2015-05-02 Thread Mark Talluto
On May 2, 2015, at 10:48 AM, Peter Haworth wrote: > However, there is no version parameter for the arrayDecode function. Does > this mean that LC7 can detect the encoding of the array and decode it > appropriately? Yes indeed! Best regards, Mark Talluto livecloud.io canelasoftware.com _

LC7 arrayEncode/Decode

2015-05-02 Thread Peter Haworth
LC7 uses a different method of encoding arrays to handle Unicode keys/contents. The arrayEncode function has a new version parameter that determines whether the new or old method is used. However, there is no version parameter for the arrayDecode function. Does this mean that LC7 can detect the

Re: Problems with arrayencode/decode

2013-01-03 Thread Richard Gaskin
Peter Haworth wrote: I tried binary access and non-binary access but got the same problem either way. What file access mode results from using the get/put URL commands? Converted text: put url ("file:"& tMyFilePath) into tData Unaltered binary: put url ("binfile:" & tMyFilePath) into tData

Re: Problems with arrayencode/decode

2013-01-03 Thread Peter Haworth
Hi Richard, I tried binary access and non-binary access but got the same problem either way. What file access mode results from using the get/put URL commands? Pete lcSQL Software On Thu, Jan 3, 2013 at 6:14 AM, Richard Gaskin wrote: > Peter Haworth wrote: > >> Hi Phil, >

Re: Problems with arrayencode/decode

2013-01-03 Thread Richard Gaskin
Peter Haworth wrote: Hi Phil, Happy to say that worked. The only real difference is the use of get url and put url so not sure what was going wrong before but thanks for correcting it! Were you reading as "file" or "binfile"? I run encoded arrays through base64Encode for network transport, bu

Re: Problems with arrayencode/decode

2013-01-02 Thread Peter Haworth
Hi Phil, Happy to say that worked. The only real difference is the use of get url and put url so not sure what was going wrong before but thanks for correcting it! Pete lcSQL Software On Wed, Jan 2, 2013 at 8:33 PM, Phil Davis wrote: > ("file:" & pFilePath) _

Re: Problems with arrayencode/decode

2013-01-02 Thread Peter Haworth
Thanks Phil, I'll give that a try. I was using both base64 and array encodings but I was stacking them together, like: base64Encode(arrayEncode(tArray)) Seems like that should work but maybe its troublesome. Pete lcSQL Software <http://www.lcsql.com> On Wed, Jan 2, 2013 at 8:

Re: Problems with arrayencode/decode

2013-01-02 Thread Phil Davis
d param" exit to top end if put base64Encode(arrayEncode(pArray)) into tFileData put tFileData into url ("file:" & pFilePath) if the result <> empty then -- an error occurred reportError "Error while saving file" exit to top

Problems with arrayencode/decode

2013-01-02 Thread Peter Haworth
I'm writing an arrayencoded array to a disk file using write to file. When I read the file back into memory with read from file until EOF and then try to arraydecode it, I get a runtime error "arraydecode:failue". In debug, I can see data appear in it right after the read. I've tried all possibl

Re: Using arrayencode for revmobile web services

2010-12-08 Thread David Bovill
The docs for arrayencode say use urlencode - I've had problems with base64encode and certain characters - and I've seen recent posts which had similar issues - never go to the bottom of them. I'll be testing these on revmobile - should work as they are not tied to any external or i

Re: Using arrayencode for revmobile web services

2010-12-08 Thread Björnke von Gierke
arrayencode produces binary, you probably in addition need to base64en- / de-code. On 8 Dec 2010, at 17:49, David Bovill wrote: > I want to send complex data to a revmobile client. XML is out because that's > not part of the revmobile client yet I believe (or at least i am assuming

Using arrayencode for revmobile web services

2010-12-08 Thread David Bovill
#x27;m thinking the way to do it is: 1. create to create an iRev script that fetches the xml, 2. turn it into an array, 3. arrayencode this 4. urlencode that 5. send to revmobile client 6. urldecode and arraydecode in revMobile 7. have nice arrays to work with It's backwards