Event-driven Environments

Most GUI environments are event-driven. Unlike traditional operating environments in which a program prompts for input and the user responds, the event-driven environment turns the relationship around. Actions are initiated by the user or system, and it's the job of the program to listen for and respond to events (events include such things as mouse movements, menu selections, and data entry).

To support this, event-driven programs have an event loop that waits for and handles events. Including an event loop in a COBOL program usually requires significant changes to existing code. However, in ACUCOBOL-GT the run-time implements the event loop and manages nearly all events for the application. There is no need for the COBOL program to include an event loop. This greatly simplifies programming for event-driven environments and preserves the traditional procedural structure of the application. Events which must be handled by the application are passed through to the program along with any necessary data. The application is typically programmed to handle these events in the same way that it handles the press of a function key. Events and event handling are described in Events and in Events Reference.