Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Level 7

array concatenation?

is there a way to concatenate arrays?

arrayone=["test","west","best"]

arraytwo=["guest","fest","blessed"]

arraythree= [arrayone+arraytwo]


this results in a two element array containing two arrays, instead of one array containing all six elements.

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
3 Replies
Highlighted
Level 7

Re: array concatenation?

This should work.
arrayone.Append(arraytwo)
0 Kudos
Highlighted
Level 7

Re: array concatenation?

seems to work. arraythree=arrayone.append(arraytwo) on the otherhand seems to result in type UNKNOWN
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
Highlighted
Level 8

Re: array concatenation?

Append doesn't return a value, it appends the second array to the first. If you need a third array, you should do this:

arrayone = [ "blah", "blah", "blah" ]
arraytwo = [ "blah", "blah", "blah" ]
arraythree = []
arraythree.Append(arrayone)
arraythree.Append(arraytwo)
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