"ZackD" wrote:
Hi! I hope this is the right place for me to post this question.
I'm new to BrightScript and am trying to figure out how to work with their associative arrays. My questions is, can an associative array in BrightScript hold another array as a value?
I'm trying to parse an associative array that looks like this:
showList = {Romance:
[
{
Title: "The Notebook",
releaseDate: "2000"
}
],
Comedy:
[
{
Title: "Caddyshack",
releaseDate: "1976"
}
]
}
If I use a statement like this:
return showlist["Comedy"]
Will this only return an array containing my Comedy video meta-data?
It seems like this should work, but I've been having trouble implementing this. Any suggestions?
Thanks!
This is probably more appropriate in its own thread, instead of hijacking this one, but...
It's not entirely clear what you're asking. Given your example above, showList["Comedy"] would return the array under "Comedy" (i.e. Caddyshack). If that's what you're expecting, but not what you're getting, then we'll need more details on what it is, exactly that you're seeing. If that's not what you're expecting, then we'll need more details on what you're trying to get.
"greubel" wrote:
Try
return showlist.Lookup("Comedy")
showlist.Lookup("Comedy"), showlist["Comedy"], and showlist.Comedy are all virtually identical, so the returned value should be the same in all cases.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)