Procedures

A Procedure is a set of command instructions that can be executed at run-time as one unit. A Procedure that returns a value is called a function. A Procedure that does not is called a subroutine. Procedures typically contain code used multiple times throughout the application. By using procedures, the total code is reduced, improving code reuse and maintenance of your application.

Procedures typically have a name, parameters, local variables, and code. The name is used when calling the procedure. Parameters are variables used to pass arguments containing values from the caller to the procedure. Code is programming statements included in the procedure, and local variables are used within the code if intermediate values need to be stored in the procedure while it is executing.

Several types of procedures exist in ATEasy:

        User procedures – These procedures are defined under a Procedures submodule or in a form procedures submodule. User procedures contain code written by the user. The code may contain calls to other procedures or even to the current procedure (recursive call).

        Events – Events are ATEasy procedures called by ATEasy when an event occurs. Two types of events are available in ATEasy: Module events and Form events. Module events are called to notify the module that a certain event occurred in the application, for example, OnAbort is called when the application is aborted. ATEasy calls form events because of user interaction with a form, menu, or control. Examples of form events include OnClick, OnMouseMove, and more. Events names and parameters are pre-defined by ATEasy and cannot be changed by the user.

        IO Tables procedures – These are procedure used to send or receive from a device or instrument using an ATEasy interface such as GPIB. An I/O table does not contain code; rather, it contains IO operations.

        DLL procedures – These are procedures residing in, and exported from, an external library (DLL). You can define and call them in ATEasy.

        Type library/COM or .NET methods and procedures – These are similar to DLL procedures as they reside in an external library. They are defined automatically when you import the COM based Type Library or .NET assembly describing these procedures.