ATEasy allows the same identifier to be used for variables in different procedures, forms, and modules. The advantage is that portions of a large project can be developed independently because developers do not need to know all the other locations where the same identifier is used. The scope rules describe the order in which ATEasy searches to find the variables with a given identifier.
If you use a qualifier with your variable, ATEasy can find the exact variable in question. In the example, Form1.MyVariable, Form1 is the qualifier to describe the name of the form within which MyVariable is contained.
A scope qualifier is used to specify exactly how the identifier is intended to be used. For example, if the scope qualifier is "X.," the prefix X can be the driver name or name of one of the keywords, such as System, Driver, Program, Form, Control, or Menu.
All scope issues look upward for their resolution. If a variable is not found within a local procedure or event, ATEasy then looks in the container of that procedure or event. For example, if you have a procedure within an event, and a variable referred to in the event handler is not found at the level of the event, ATEasy then looks upward to the container of that event, whether that container is a control or the form. The next step up from the form would be the enclosing module, the Program, or the System. Once the search reaches the module level, ATEasy can look in libraries, such as the internal library, which is common to all modules.
If the variable name still has not been resolved, ATEasy starts looking in the Drivers. Driver scope rules differ from program scope rules. ATEasy searches the Drivers for public items that will resolve the variable name, but it does so in the reverse order from the order in which the Drivers were loaded.
Driver scope rules behave this way because high-level Drivers can refer to low-level Drivers, which need to be loaded first. Within the Drivers, ATEasy returns the first matching name it finds. ATEasy does not continue to find other matches, even if they exist.