Roku Developer Program

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

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
joetesta
Level 10

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

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.
https://github.com/belltown/
0 Kudos
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. Smiley Happy
0 Kudos
tim_beynart
Level 7

Re: Did OS 7.1 break roArray??

ah OK, so the error message is new. Smiley Surprisedops:
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
Level 8

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