Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
greubel
Visitor

Re: Designing a Custom Channel Experience for Roku

Try
return showlist.Lookup("Comedy")
0 Kudos
TheEndless
Channel Surfer

Re: Using Associative Arrays in BrightScript

"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)
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.