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

*** Warning v3.0 May Break your Channel ***

I want to send out another plea to regression test your channels on v3.0. BrightScript v3.0 is much stricter about syntax than it was in v2.9 and many channels now crash where before they didn't. There are other incompatibilities as well...

There's one change I've had to make in about a dozen channels so far and want to warn you to check your code for it. Anywhere that you may be checking the type and comparing it to the value "roString", you should also compare to "String" as this is a new v3.0 type.

Old code:

if type(b) = "roString"


New code:

if type(b) = "roString" or type (b) = "String"


--Kevin
0 Kudos
18 REPLIES 18
gonzotek
Visitor

Re: *** Warning v3.0 May Break your Channel ***

This is the kind of info that would be perfect on the new dev blog. 🙂
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
TheEndless
Channel Surfer

Re: *** Warning v3.0 May Break your Channel ***

I believe there's also a new "Integer" type (in addition to "roInt").
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
jbrave
Channel Surfer

Re: *** Warning v3.0 May Break your Channel ***

I think even on 2.9 there are cases where you will see type ="roInt" and other cases where type is "Integer" and a few other weird things like that, which I have already had to handle. Don't remember if there is an "roInvalid" but I think I have seen that at least once...

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
destruk
Streaming Star

Re: *** Warning v3.0 May Break your Channel ***

Yes, had to update one line of one channel to check "roInt" as well as "roInteger", also, the USB channel code for 2.9 doesn't work on 3.0 firmware - so the 3.0 SDK has working/fixed code for it.
0 Kudos
destruk
Streaming Star

Re: *** Warning v3.0 May Break your Channel ***

If you 'downgrade' the firmware to 2.9, then you can't get 3.0 firmware again?
0 Kudos
mixe
Visitor

Re: *** Warning v3.0 May Break your Channel ***

Hi I have got a problem with the box breaking for v3.0 build 2202

To do this all I have to do is to download an app via the debug to the box, when it crashes (probable because there is a bug in the code)

The box then restarts it self

next I then try to loading one of the channels (say Vimeo or some another one) the app loads ok, but then when it gets to the point where the video starts to load, the box then crashes.

Post note;
The only way I have found to fix this problem is to unplug everything from the box (HDMI + Ethernet + power) and then plug every thing back in again. Just unplugging the power doesn't work!
0 Kudos
lucasgonze
Visitor

Re: *** Warning v3.0 May Break your Channel ***

Kevin, can you verify that it's not just strings that are affected? If so, can you document the types that are affected and what the changes are?

I have found many instances of the type operator being used to affect control flow, e.g. if( type(childStatus) = "Integer" ) .... We need a precise list of what's changing so that we can touch each instance of the type operator.
0 Kudos
RokuKevin
Visitor

Re: *** Warning v3.0 May Break your Channel ***

It's not just strings that are affected by this issue. It's any intrinsic type that can be autoboxed.... Including
Integer, roInteger
Float, roFloat,
String, roString
Boolean, roBoolean
Double, roDouble


--Kevin
0 Kudos
lucasgonze
Visitor

Re: *** Warning v3.0 May Break your Channel ***

Others may find this useful:
function typeNormalize(incomingType)
if( incomingType = "Integer" ) return("roInt")
if( incomingType = "Float" ) return("roFloat")
if( incomingType = "String" ) return("roString")
if( incomingType = "Boolean" ) return("roBoolean")
if( incomingType = "Double" ) return("roDouble")
return(incomingType)
end function


Call it like:
if( typeNormalize(type(foo)) = "roInt" ) return
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.