Forums > MaxMSP

Accessing a dictionary from an array of dictionaries

July 31, 2012 | 11:22 am

Here’s an example JSON/dict structure:

{
    "first": {
        "list": [
            {
                "second": "value"
            }
        ]
    }
}

Now my JSON doesn’t look like that, but the example gets to the heart of the matter: get-ing "value". When I message my dict:

get first::list[0]

I of course receive a pointer to another dictionary. However, when I message my dict:

get first::list[0]::second

I don’t receive the string "value" as anticipated, instead I get nothing at all. So what message am I supposed to return to dict in order to get the string "value"?


August 1, 2012 | 12:08 pm

Hi there,

you are right… I get the same behavior.
It seems it is not possible to get values from lists of dictionaries.

You might have found a bug or a limitation of the [dict] object.
I would report it as a bug to the C74 folks and see what they say…

- Luigi


September 25, 2012 | 3:57 pm

check my reply here. this may help your situation:

http://cycling74.com/forums/topic.php?id=42681&replies=2#post-204566


Viewing 3 posts - 1 through 3 (of 3 total)