Function Scope
Function scoping is dynamic. This means that the scope in which the function executes is the scope of the function caller. For example, if a function is called from the scope of a script on the element with ID Table1, then all of the properties of element Table1 are available to the function. Properties that are not qualified with an element ID (e.g., “table,” “visible,” as opposed to “TableX.table,” “TableX.visible”) refer to the caller, Table1.
This scope rule means that if a variable is not declared within a function, the script engine will try to find it in the enclosing scopes. Exactly which object will be located depends on where the function is called. To avoid ambiguity, when you use a variable in a function, you should either declare it in the function, or pass it in as a parameter.
| << Editing a Function in the Script Library | © 1996-2013 InetSoft Technology Corporation (v11.4) | 3.5 Deploying a Report, Data Source, or Other Asset >> |