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: 
wpcs
Visitor

roku arrays

I'm new at roku development, and have some programming experience.
I'm trying to capture 3 previous sku# into an array. I've been trying to get it to work using

prevItemList = CreateObject("roArray",3,true)

but not having much luck getting the list to print.

Can anyone point me to an example, or give me some ideas on this.

thanks.
scott
0 Kudos
2 REPLIES 2
NewManLiving
Visitor

Re: roku arrays

You need to use Push to populate your array
If you do it this way
myAyrray.Push( myData1 )
myArray.Push (myData2 )
...

For each data in myArray
Print data
End for
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
EnTerr
Roku Guru

Re: roku arrays

No need to bother with createObject, you can directly construct array with [ ]; also add/remove elements at the end with .push/.pop.
BrightScript Debugger> SKUs = [123456, "AK-47", "RPG-7"]
BrightScript Debugger> ? SKUs
123456
AK-47
RPG-7
0 Kudos