Naming conventions
This topic describes the rules for naming parts and variables and for assigning values to properties such as name.
EGL has three categories of identifiers:
- EGL part and variables names.
- External resource names that are specified as property values in part definitions or variable declarations. These names represent special cases, and the naming conventions depend on the conventions of the runtime system.
- EGL package names such as com.mycom.mypack. In this case, each character sequence is separated from the next by a period, and each sequence follows the naming convention for an EGL part name. For details on the relationship of package names and file structure, see EGL projects, packages, and files.
An EGL part or variable name is a series of 1 to 128 characters.
Except as noted, a name must begin with a letter or an underscore
and can include additional Unicode letters as well as digits and currency
symbols. The following additional restrictions apply:
- The first characters cannot be EZE in any combination of uppercase and lowercase.
- A name cannot contain embedded blanks or be an EGL reserved word (see EGL reserved words).
- A name cannot include hyphens (unless you are running in VisualAge® Generator compatibility
mode). Otherwise, it is difficult for the programmer to distinguish
whether "X-Y" in the following example is an expression or a name:
if(X-Y) addToTotal(); end
Special considerations apply to parts:
- In a Record part, the name of a logical file or queue can be no more than 8 characters
- In various parts, the alias is incorporated into the names of generated output files and Java™ classes. If you do not specify the alias, EGL uses the name of the Program part, but truncates it (if necessary) to the maximum number of characters allowed in the runtime environment. See "Compatibility" in this topic.
Compatibility
| Platform | Issue |
|---|---|
| COBOL generation | Names of generated outputs are truncated to
conform to the maximum permitted lengths, which vary by part type:
|
| VisualAge® Generator compatibility mode | The following rule applies to part and variable names but has no effect on package names: Characters after the initial character can include "at" signs (@), hyphens (-), and pound signs (#). |