- You can base a variable on one of several primitive types, as in this
example:
myItem CHAR(10);
For details, see Primitive types.
- You can base a variable on a dataItem part or record part, as in this
example:
myRecord myRecordPart;
For details, see Typedef.
- You can compose a program parameter as described previously for
variables; alternatively, you can base it on a form part, as in this
example:
myForm myFormPart;
The form must be accessible through a form group that is identified in one
of the program's use declarations. A form accessed as a parameter
cannot be displayed to the user, but can provide access to field values that
are passed from another program.
- Some parts are generated independent of the program and act as variables
that are global to the program:
- If a part is of type dataTable, library, or pageHandler and is visible to
the program, the part is treated as a program-global variable. For
referencing convenience, you can include a dataTable or library part in one of
the program's use declarations.
- If a part is of type formGroup, is visible to the program, and is included
in one of the program's use declarations, the form parts that are
referenced in that formGroup are also treated as program-global
variables. All the fields in those forms are also available as
program-global variables.
- Several rules concern the entities that are within parts that are
available to the program:
- If a dataTable part is a program-global variable, the fields in that part
are also global to the program.
- If a library part is a program-global variable, the following entities in
that part are also global to the program:
- Public functions
- Public variables
- Public constants
For details on visibility, see References to parts. See also
Use declaration.
- You can compose a function parameter on the basis of a primitive type, a
dataItem part, or a record part; alternatively, you can base a function
parameter on a loose primitive type, as in this example:
myNumber Number;
In addition, a function parameter can be a dynamic array of records or data
items. For details, see Function part in EGL source
format.
- Finally, you declare a constant by associating an identifier with a number
or quoted string. That initial value cannot be changed at run time, as
in these examples:
myNumber 10.10;
myString "Great software!";
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.