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: 
joetesta
Roku Guru

Default values?

What is the default value of a boolean?  I know I can create a simple test app and find out myself, but why doesn't the documentation state clearly somewhere what the default value of a boolean is?  Would be just lovely if this page told me:
https://sdkdocs.roku.com/display/sdkdoc ... +and+Types

I would like to know so that I know whether or not to initiate the boolean or not:
https://sdkdocs.roku.com/pages/viewpage ... Id=1608549
If not specified, the default value for the field type is used
aspiring
0 Kudos
4 REPLIES 4
EnTerr
Roku Guru

Re: Default values?

There is no "default value" concept in BrightScript, i don't think.
This is a scenography issue, so take it up with the RSG guy 😛

As a rule of thumb though, i'd expect the "zero-ish" value to be default, e.g. [ ], { }, False, "", invalid... 
0 Kudos
RokuKC
Roku Employee
Roku Employee

Re: Default values?

BrightScript itself doesn't have any concept of default values.

For Scene Graph fields, however, the default value would be false (0, "", empty, and so on for other types).

EnTerr beat me to it 😉  ... what he said.  😮
0 Kudos
joetesta
Roku Guru

Re: Default values?

Thanks guys - 
I love how you guys always imply that I'm making this stuff up 🙂

https://sdkdocs.roku.com/pages/viewpage ... Id=1608549
If not specified, the default value for the field type is used

My guess would have been what you said (false) but I wanted a doc to link to.
aspiring
0 Kudos
EnTerr
Roku Guru

Re: Default values?

"joetesta" wrote:
Thanks guys - I love how you guys always imply that I'm making this stuff up 🙂
https://github.com/rokudev/docs/issues , maybe that will help.
0 Kudos