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: 
squirreltown
Roku Guru

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 4
TheEndless
Channel Surfer

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
Roku Guru

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
Binge Watcher

Re: Arrg-array

neat.

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



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
Roku Guru

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
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.