Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
squirreltown
Level 9

Arrg-array

flyobject = { bitmap:invalid, ball:5, bkshadow:10}
bigarray = [flyobject,flyobject,flyobject]


This stuff drives me nuts sometimes.
Again - how do I get/print just one value from the AA"flyobject"?

bigarray[0] prints a whole AA fine.
Kinetics Screensavers
0 Kudos
4 Replies
TheEndless
Level 7

Re: Arrg-array

It's not totally clear what you're asking, but you access individual elements of an AA by they're key...
print bigarray[0].bitmap, bigarray[0].ball, bigarray[0].bkshadow

If that's not what you're asking, please clarify your question.. possibly with the expected value you're looking for.
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
squirreltown
Level 9

Re: Arrg-array

Thank you Endless, yes thats what i wanted. Embarrassed I had to ask but tried every combination of brackets and quotes and what-have-you for an hour and figured that was enough.
Kinetics Screensavers
0 Kudos
BradC
Level 7

Re: Arrg-array

neat.

I didn't even realize bs could do multidimensional arrays like that.
I could've used that a few times. Smiley Very Happy



thx for posting. TIL.
♦MiniGolf♦HangMan♦Brain Puck♦Retro Tennis♦BORK♦FLIP♦Pathogen♦Pathogen 2♦Shut the Box♦Birdie♦Logic♦Dots♦Pool♦küglo♦Bubble Wrap♦Trivia Channel♦Mancala♦Air Hockey♦Weather♦CAMERA♦Your Photos Screensaver♦Desert Beauty Screensaver♦Wild Lakes Screensaver♦
0 Kudos
Komag
Level 9

Re: Arrg-array

Yes, it can be any combination with multiple levels deep as well, such as:

bigAA = {k1:[a,b,c], k2:[[d,e,f], FALSE], k3:"Ben", k4:["Sam", {k1:"Why not", k2:[1, 2, 3]}, "Tom"], k5: TRUE }
PRINT bigAA.k4[1].k2[2]

3
0 Kudos