0

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!

Nas Banov
  • 28,347
  • 6
  • 48
  • 67

1 Answers1

0

Yes, showList["Comedy"] or showList.comedy give you

[ { Title: "Caddyshack", releaseDate: "1976" } ]
Nas Banov
  • 28,347
  • 6
  • 48
  • 67
  • Thanks! I tried this right after I posted the question and it worked. The problem I was running into was really from the way I was storing the array inside the showlist variable – Zack Dinerstein Mar 20 '14 at 16:52
  • Because I placed a linebreak after "Romance: ", BrightScript wasn't recognizing the code as a valid associative array. I believe showlist was coming back as when I tried to access it. I think the linebreaks were causing that problem. – Zack Dinerstein Mar 20 '14 at 16:54