You can call a procedure from a procedure or test code in the Program, System, and Driver modules or within a Form procedure. When a procedure name is called, ATEasy will search for the procedure to locate where it is defined.
Since procedures in different modules (or even in different submodules of the same module) can have the same name, ATEasy must decide which procedure is being referred to in the current code statement. ATEasy follows a specific search sequence and the first procedure that ATEasy finds with the given name will be used.
To bypass the way ATEasy searches for a procedure, you can also use the Scope Resolution Operator to specify where the procedure is defined. For example, 'Program.Average' is ModuleName.ProcedureName using Scope Resolution Operator rules. For more information, see Member Operator ('.') and Scope Resolution Operator.
How ATEasy searches for a procedure is important because procedures defined in a Program, System or Driver module, or within a Form can have the same name.
In general ATEasy will first search for a procedure in the current module, the module where the procedure is used, in the following order:
If the procedure is used in a control event, ATEasy searches in the Control methods or properties.
If the procedure is used in a Form Procedure or Event, ATEasy searches in the Form procedures first, then the Form properties or methods.
ATEasy then looks in the module procedures, module COM libraries procedures, properties, and methods.
If the procedure is not found, ATEasy will then search for public procedures that are visible in other modules as follows:
If the current module is a Program module, ATEasy searches in the System module and then in the System Drivers (starting from the last driver to the first).
If the current module is a System module, ATEasy searches in the System Drivers (starting from the last driver to the first).
If the current module is a Driver module, ATEasy searches in the System Drivers (starting from the last driver to the first).