Parts
An EGL file contains a set of parts, each of which is a unit of declaration in the overall declaration of the program. You declare parts in whatever order is convenient for you, and you name each one.
Parts are categorized as logic, data, user interface (UI), or build parts:
- Logic parts define a run-time sequence that you write in the EGL procedural language--
- A function part is the basic unit of logic and is included in program, pageHandler, and library parts.
- A pageHandler part (or page handler) is a specialized program that controls the interaction between the user and a Web page.
- A program part is one of these types:
- A textUI program interacts with the user by way of a character-based display. The display appears in a command window, not in a Web browser.
- A basic program performs a task without interacting with the user in real time.
You can declare a basic or textUI program to be a main program, which is started by the user, by a program transfer other than a call, or directly by an operating-system process. Also, you can declare either kind of program to be a called program, which can be invoked only by a call.
For other details on the run-time deployment of main and called programs, see Run-time configurations.
- A library part is a collection of shared functions and variables and is generated and compiled independent of any program or page handler. The library resources can be made available in your program.
- Data parts define the data structures that are available to your program. In some cases a data part includes a structure, which is a hierarchical layout of structure items that each define an area of memory. Each structure item is substructured (as a word is substructured into letters) or is not divisible (as a letter is not divisible).
Some data parts can act as typedefs (models of format) for variables and for other data parts:
- A record part contains a structure, and the structure items are usually called record items; and a subset of record parts can access data in permanent storage.
- A dataItem part defines a data area that is not divisible.
A dataTable part is an independently generated data part containing an array of rows initialized with values specified in the part definition. Unlike the other data parts, each dataTable part is essentially a global variable that is available by name throughout your program.
- UI (user interface) parts describe the layout of data presented to the user in fixed-font screen and print forms. UI parts are of the following types:
- A form part is an organization of data that is presented to the user. One kind of form part organizes the data sent to a screen in a text application, and another organizes the data sent to a printer in any kind of application. A form includes an internal structure, and the structure items are usually called fields or form items.
- A formGroup part is a collection of forms and is generated as a separate output. A program can include only one form group for most uses, along with one form group for help-related output. The same form can be included in multiple form groups.
Each of the previous UI parts is essentially a global variable that is available by name throughout your program.
You create Web user interfaces with Page Designer, which builds a JSP file and associates it with an EGL page handler. The JSP file replaces the role of the UI part for applications that interact with the user by way of the Web.
- Build parts define a variety of processing characteristics:
- A build descriptor part controls the generation process and indicates what other control parts are read during that process.
- A linkage options part gives details on how a generated program transfers to other programs. The information in this part is used at generation time, test time, and run time.
- A resource associations part relates an EGL record with the information needed to access a file on a particular target platform; the information in this part is used at generation time, test time, and run time.
Logic, data, and user interface parts are also categorized as primary parts or subparts. The primary parts are as follows:
- DataTable
- FormGroup
- Library
- PageHandler
- Program
An EGL source file can include zero to many subparts but can include no more than one primary part. The primary part (if any) must be at the top level of the file and must have the same name as the file.
Related concepts
Build descriptor part
Compatibility with VisualAge Generator
DataItem part
EGL projects, packages, and files
Function part
Import
Introduction to EGL
Linkage options part
Program part
Record parts
References to parts
References to variables and constants
Resource associations and file types
Run-time configurations
Structure
Typedef
Web support
Related reference
EGL build-file format
EGL editor
EGL source format
EGL statements
Primitive types