Variable Scope


The term "scope" refers to the visibility of a variable. In Visual Builder a variable may be scoped as either local to a form or global - visible to all forms. If you define a variable, say, MyVar as having global scope, then all forms will be able to access the contents of MyVar. If MyVar is defined as having local scope it is then only visible to the form that created it. If MyVar was created, for example, in the form "XYZ" it can only be accessed while XYZ is running. If the form "ABC" is loaded in later, MyVar will not be accessible to that form.

You can define local variables with the same name to different forms. Even though the variable may have the same name, it will hold a value unique to each form it is created in.

Global variables are useful when you wish to pass on instructions to other forms. For example, if you are executing a chain of forms (i.e., a set of reports) in a definite sequence, you can store user input in the first form. There will be no need to prompt users for the same information if it is required in the next form.



CAPITAL VISUAL BUILDER