how to create a list in easyJSON

Matt Maier blueback09 at gmail.com
Sat Dec 31 07:35:23 CET 2016


   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, which is
preserved in the JSON conversion.

On Fri, Dec 30, 2016 at 10:12 PM, Andre Garzia <andre at andregarzia.com>
wrote:

> 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" <blueback09 at gmail.com> 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 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 something like this:
> >
> > array[one] = 12345,12345,12345
> > array[two] = 12345,12345
> >
> > and what I get back from easyJSON is this:
> >
> > {"one":"12345,12345,12345","two":"12345,12345"}
> >
> > when what I'm trying to get is more like this
> >
> > {"one":["12345","12345","12345"],"two":["12345","12345"]}
> > _______________________________________________
> > 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
> >
> _______________________________________________
> 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