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: 
tim_beynart
Channel Surfer

Did OS 7.1 break roArray??

I am seeing a failure in an in-market app:
BRIGHTSCRIPT: ERROR: Runtime: "roArray": invalid number of parameters
This is caused by the following line:

m.adbeaconlist = CreateObject("roArray")

I never saw this error before when we tested and verified the application. Now our advertising tracking is broken. In production.
My fix is to use bracket notation:

m.adbeaconlist = []


But my question is, why did this break? What changed in OS7.1?
0 Kudos
5 REPLIES 5
joetesta
Roku Guru

Re: Did OS 7.1 break roArray??

https://sdkdocs.roku.com/display/sdkdoc/roArray
CreateObject("roArray", size As Integer, resize As Boolean)

In the app I'm working on, roArray is always created with the 'size' and 'resize' parameters and we're not seeing this problem with the new firmware.
eg
tests = CreateObject("roArray", 10, true)
aspiring
0 Kudos
belltown
Roku Guru

Re: Did OS 7.1 break roArray??

"tim_beynart" wrote:
I am seeing a failure in an in-market app:
BRIGHTSCRIPT: ERROR: Runtime: "roArray": invalid number of parameters
This is caused by the following line:

m.adbeaconlist = CreateObject("roArray")

I never saw this error before when we tested and verified the application. Now our advertising tracking is broken. In production.
My fix is to use bracket notation:

m.adbeaconlist = []


But my question is, why did this break? What changed in OS7.1?

I remember running into that years ago, long before the 7.1 update. As far as I know, you've always needed to supply a length parameter e.g. CreateObject("roArray", 10, true). Unless there was a prior OS update during which the check was not happening, I'm not sure why you'd see the error now and not earlier.
0 Kudos
RokuKC
Roku Employee
Roku Employee

Re: Did OS 7.1 break roArray??

"tim_beynart" wrote:
I am seeing a failure in an in-market app:
BRIGHTSCRIPT: ERROR: Runtime: "roArray": invalid number of parameters
This is caused by the following line:

m.adbeaconlist = CreateObject("roArray")

I never saw this error before when we tested and verified the application. Now our advertising tracking is broken. In production.
My fix is to use bracket notation:

m.adbeaconlist = []


But my question is, why did this break? What changed in OS7.1?


The error message is printed now, but the functional behavior is the same as it always has been:
CreateObject("roArray") will return invalid.

As joetesta said, the size and resize parameters are required.

The reason for this error message is exactly to point out what was previously a silent failure.

Your fix to replace the call to CreateObject with [] is a perfectly good one. 🙂
0 Kudos
tim_beynart
Channel Surfer

Re: Did OS 7.1 break roArray??

ah OK, so the error message is new. :oops:
Ends up this was a total red herring. I have bracket notation elsewhere in the logic that initializes the array, so the invalid was never an issue. For once I have a side effect that fixed something instead of breaking it! A win for sloppiness!
I'll have to look elsewhere to explain what's up with my production issue... :x
0 Kudos
EnTerr
Roku Guru

Re: Did OS 7.1 break roArray??

Hehe... i have been trying for a while to convince RokuKC&co to rename
BRIGHTSCRIPT: ERROR: Runtime: ... klaatu barada nikto ...
to what they really are, a
WARNING: ... klaatu barada nikto ...

Plus the awful "colon centipede" form that's not any English i have learnt (is that a BASIC: speech: impediment?).

Yes, it is a bit of a ruse, a red herring as is. RokuKC thinks it's better to mislead people into thinking it's a fatal error, while i think even if named a "warning" people will still pay attention and address it - but with less confusion.
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.