Progress
Programming
Handbook


Program Execution in a Procedure-driven Program

The flow of execution in a procedure-driven program is generally top-down and linear. User interaction with the program is limited; the user can choose from a few preprogrammed tasks. Each of these tasks consists of several actions that have been prearranged by the programmer. The sequence of these actions is also determined by the programmer; once a user selects a task, the application leads the user step-by-step through the actions required to complete the task. As actions are performed, the program might provide the user with status messages.

In the procedure-driven model, the application initiates calls to the operating system for user input when the program is ready. Figure 2–1 shows this process.

Figure 2–1: A Procedure-driven Application Calling the Operating System

Because movement from procedure to procedure is preprogrammed, the programmer is said to determine the flow of execution. The program performs only one process at a time. Generally, execution flows from the beginning of the source code to the end. The program may contain code loops, branches, and jumps that alter this flow, but it is the programmer who must plan for and manage the conditions for such alterations.

Figure 2–2 shows the flow of execution in a typical procedure-driven program.

Figure 2–2: Flow of Execution in a Procedure-driven Program

Program execution typically begins at a unique starting point, such as when the user issues a RUN statement. Execution continues line by line through any number of procedures. With the exception of programmed branches to other procedures, program execution is sequential, both within the program and within each procedure. Program execution stops when it reaches the end point in the program. Because branching and looping behavior is tightly controlled, you can trace the flow of execution in a procedure-driven program.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095