A function provides the basic unit of the logic structure for a program. For example, input and output operations that take place are done in functions.
A single function can contain only one I/O operation. However, a function is not required to contain an I/O operation. In this tutorial, your sample program includes some functions that include an I/O operation and some that don't.
You need to build a simple logic structure within the main function you have defined. This allows you to do a quick, basic definition of the overall structure of the program.
To begin building the program structure:
The New Part Package/Application window is displayed.
Note: | You can type in lowercase. The editor will convert your code to uppercase when you select Save, Validate, or Validate and Format. |
Each line in this function invokes the function named.
The list box on the left displays I/O options, which define the type of operation a function will carry out. The list box on the right displays I/O objects, the data parts on which I/O options are performed. The EXECUTE option does not have an I/O object. Here it is used to control the flow between functions.
Now you can partially define each of the performed functions. By partially defining these functions, you can test the program structure without completely defining the program. You can supply the logic of the program later. Providing partial definitions of the program and its components is one way to use VisualAge Generator Developer for rapid prototyping.
That branch of the structure diagram is expanded.
The New Part Package/Application window is displayed.
The new part is created and the Function Editor is displayed.
To define an I/O option and an I/O object for GET-LIST:
The New Part Package/Application window is displayed.
The SETINQ option selects a set of rows from an SQL row record.
Customer is the name you will use when you define the SQL row record that SETINQ will select from.
Your program structure should look like the one shown in Figure 51.
All functions for a program are created using the steps you just completed. The following is a summary of those steps: