Forum Discussion

joetesta's avatar
joetesta
Roku Guru
9 years ago

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

4 Replies

  • 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... 
  • RokuKC's avatar
    RokuKC
    Roku Employee
    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.  😮