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

function(variable as boolean) legal?

The manual doesn't indicate that this is possible, but I wonder... the function can return boolean if it is function(variable as integer) as boolean but boolean is not listed as a type of function parameter. Are we forced to use an integer 0 or 1 to represent a boolean value when calling a function or is type object necessary?

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
5 REPLIES 5
TheEndless
Channel Surfer

Re: function(variable as boolean) legal?

See section 3.2 of the BrightScriptReferenceManual.pdf. Boolean is definitely a type.
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: function(variable as boolean) legal?

nevermind, looks like it should be "as dynamic" and it can be any type... function(isboolean as dynamic)

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
jbrave
Channel Surfer

Re: function(variable as boolean) legal?

I was looking at 5.14 which only lists the following types as function parameters:

• Integer
• Float
• Double
• String
• Object
• Dynamic
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
TheEndless
Channel Surfer

Re: function(variable as boolean) legal?

Fair enough... but trust me, boolean is perfectly legal as a parameter. I use it all the time.
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
RokuKevin
Visitor

Re: function(variable as boolean) legal?

Joel,

You've found a documentation bug. Thanks for pointing it out!

functions and indeed return the type Boolean.

--Kevin
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.