JSON fnc questions

  1. 7 years ago

    Hi there,

    I'm trying to convert some data via the JSON functions that comes with ALiVE which then should be able to be read through my website. Anyhow, for some reason I seem to not be able to create the JSON elements with both key and values, been reading through the functions itself on the GitHub page just to figure it out but no joy.

    Anyone here that might be able to help out, this is the code that I have so far just as a test so I can figure it out

    _map = ["", "new"] call ALiVE_fnc_unorderedMap;
    [_map, "insert", ["key", "value"]] call ALiVE_fnc_unorderedMap;
       
     _test = ["", "encode", [_map]] call ALiVE_fnc_JSON;
     diag_log format["%1",_test];

    Need the code to be output as

    {
          "key": "value"
    }

    the closest I got was the return of

    {
          "value"
    }

    Hopefully, someone can share some light with this functions, been trying to wrap my head around the functions for a while now and I still can't seem to get it to work correctly.

 

or Sign Up to reply!