Scope refers to the visibility of a variable, a procedure, or an object to other procedures in a program. In the old days, all data was globalthat is, you could get or change the value of any variable anywhere in a program. Later, when subroutines and function procedures were added to Basic, data could be global or local to a procedure. Today there are four levels of scope, listed here:
Limiting the scope of an item provides control over how the item can be changed. The wider the scope, the more careful you have to be. It makes sense to limit the scope of items as much as possible. In fact, global variables can be eliminated entirely using property procedures. These procedures provide an additional level of control over global data by checking whether a value is valid and whether the calling procedure has permission to change the data.