Re: how to create a list in easyJSON

2017-01-08 Thread pink via use-livecode
In the most recent version of easyJSON, numeric keyed arrays will turn into JSON arrays, older versions may vary. fastJSON does this by default, but it can be overridden by passing true into the keepNumeric parameter: arrayToJson(pArrayData, keepNumeric) for example: put arrayToJSON(inputArra

Re: how to create a list in easyJSON

2017-01-08 Thread pink via use-livecode
In the most recent version of easyJSON, numeric keyed arrays will turn into JSON arrays, older versions may vary. fastJSON does this by default, but it can be overridden by passing true into the keepNumeric parameter: arrayToJson(pArrayData, keepNumeric) for example: put arrayToJSON(myArray,true)

Re: how to create a list in easyJSON

2017-01-07 Thread Matt Maier via use-livecode
As a warning for others, fastJSON is not directly interchangeable with easyJSON. I'm using a big array that has a couple levels of numeric keys before you get to the text keys. When fastJSON converts the array to JSON it throws out the numeric keys and just turns everything into a list. I don't t

Re: how to create a list in easyJSON

2017-01-03 Thread Bob Sneidar
Hmmm... all of this may explain why a table in a PDF fillable form breaks the controls out as columns, not records. So when populating an FDF file, my data needs to have each column in it's own variable, or else I have to do nested repeats to place it all correctly. Bob S __

Re: how to create a list in easyJSON

2017-01-02 Thread J. Landman Gay
On 1/1/17 12:31 PM, pink wrote: what version of easyJSON are you using? I just copied the library from: https://github.com/luxlogica/easyjson/blob/master/easyjson.lc used this code: put "12345" into tArray["one"][1] put "12345" into tArray["one"][2] put "12345" into tArray["one"][3]

Re: how to create a list in easyJSON

2017-01-01 Thread pink
check the script... there should be a function: isNumericalArray this is the function which appears to be either not there, or is not functioning correctly -- View this message in context: http://runtime-revolution.278305.n4.nabble.com/how-to-create-a-list-in-easyJSON-tp4711279p4711304.html

Re: how to create a list in easyJSON

2017-01-01 Thread Matt Maier
That's a good question. The stack doesn't have a version number in it, at least not that I found. On Sun, Jan 1, 2017 at 10:31 AM, pink wrote: > what version of easyJSON are you using? I just copied the library from: > https://github.com/luxlogica/easyjson/blob/master/easyjson.lc > > used this c

Re: how to create a list in easyJSON

2017-01-01 Thread pink
what version of easyJSON are you using? I just copied the library from: https://github.com/luxlogica/easyjson/blob/master/easyjson.lc used this code: put "12345" into tArray["one"][1] put "12345" into tArray["one"][2] put "12345" into tArray["one"][3] put "12345" into tArray["two"][

Re: how to create a list in easyJSON

2016-12-31 Thread Mark Wieder
On 12/30/2016 05:27 PM, Matt Maier wrote: I'm trying to send a list of strings to an API. Best I can tell it's interpreting the entire list as one string. Is there a way to send data to easyJSON such that it returns a JSON list of strings instead of one monolithic string? For example, I've got

Re: how to create a list in easyJSON

2016-12-31 Thread Richard Gaskin
Matt Maier wrote: > This code: > >put "12345" into tArray["one"][1] >put "12345" into tArray["one"][2] >put "12345" into tArray["one"][3] >put "12345" into tArray["two"][1] >put "12345" into tArray["two"][2] >put jsonfromarray(tArray) into tWhatever > > gives me this resul

Re: how to create a list in easyJSON

2016-12-31 Thread Matt Maier
This code: put "12345" into tArray["one"][1] put "12345" into tArray["one"][2] put "12345" into tArray["one"][3] put "12345" into tArray["two"][1] put "12345" into tArray["two"][2] put jsonfromarray(tArray) into tWhatever gives me this result: {"one":{"3":12345,"1":12345,"2":12

Re: how to create a list in easyJSON

2016-12-31 Thread pink
in a nutshell, easyJSON creates what you want by using numeric keys so: array[one][1] = 12345 array[one][2] = 12345 array[one][3] = 12345 array[two][1] = 12345 array[two][2] = 12345 would produce the results you are looking for (technically the numbers don't have to be sequential, it just has to

Re: how to create a list in easyJSON

2016-12-31 Thread Richard Gaskin
Matt Maier wrote: ... > when what I'm trying to get is more like this > > {"one":["12345","12345","12345"],"two":["12345","12345"]} Let's look at the other side of that and see if we can find a good round-trip solution: What would the string you have above look like in a LiveCode array? --

Re: how to create a list in easyJSON

2016-12-30 Thread Matt Maier
put "12345,12345,12345" into tArray["one"] put "12345,12345" into tArray["two"] split tArray["one"] by comma put jsonfromarray(tArray) into tWhatever result {"one":{"3":12345,"1":12345,"2":12345},"two":"12345,12345"} So looks like that just created an array with a numeric index, whic

Re: how to create a list in easyJSON

2016-12-30 Thread Andre Garzia
Try placing a: Split tArray[one] by comma Before converting to json. Om om Andre Ps: typing on the phone, sorry for my brevity Em 30 de dez de 2016 15:29, "Matt Maier" escreveu: > I'm trying to send a list of strings to an API. Best I can tell it's > interpreting the entire list as one stri