Player APIs (BrightScript & Ja...
...
BrightScript
Language Reference

Scope

1min
brightscript uses the following scoping rules global variables are not supported; however, there is a single hard coded global variable (“global”) that is an interface to the global functions docid\ nsjxffr7olfgdwgjfebme , which contains all global library functions functions declared with the function statement are global in scope; however, if the function is anonymous, it will still be local in scope local variables exist within the function scope if a function calls another function, that new function has its own scope labels exist within the function scope block statements such as for / end for and while / end while do not create a separate scope