EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2012
02:07 PM
Why do CreateObject("roAssociativeArray")?
I am reading some sample code and i notice assoc.arrays commonly created as
Related to that, why do
aa = CreateObject("roAssociativeArray")Why so complicated, why not do just
aa = { }Seems much easier to type and i wonder if i am missing something, as to the reason why it was done (in what seems to me) more clumsy way.
Related to that, why do
aa.posterItems = CreateObject("roArray", 5, true)and not
aa.PosterItems = [], if for all practical purposes is the same?! (in both cases arrays are re-sizable; "5" is a just a hint about initial alloc, since arr.count()==0)
1 REPLY 1

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2012
09:12 PM
Re: Why do CreateObject("roAssociativeArray")?
Per the docs, {} and [] are shortcuts for the CreateObjects. My guess is that they were added later in the lifecycle and the examples were never updated and/or it's still present to allow for explicit declaration for those who prefer it.
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)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)