This function takes a string representing JSON, and returns a list of the top level.

Syntax

list llJson2List( string src );

Forced delay: 0.0 seconds. Energy: 10.0.

Parameters

string src

To convert a list into a json formatted string use llList2Json.

Return value

Returns a list made by parsing src, a string representing json.

Specification

See Json_usage_in_LSL

Examples

default
{
    state_entry()
    {
        list items;

        string value = "89556747-24cb-43ed-920b-47caed15465f";
        items = llJson2List(value);
        // ["89556747-24cb-43ed-920b-47caed15465f"]

        string object = "{\"pi\": 3.14, \"set\": [1,2,3], \"status\": \"ok\"}";
        items = llJson2List(object);
        // ["pi", 3.140000, "set", "[1,2,3]", "status", "ok"]

        string array = "[0, 3.14, [1,2,3], {}]";
        items = llJson2List(array);
        // [0, 3.140000, "[1,2,3]", "{}"]
    }
}

See also

Functions

Articles

Deep notes

History

Date of Release 20/05/2013