Overview of EGL properties and overrides
With few exceptions, each logic, data, and user-interface part in EGL has a set of properties, whether assigned or by default. The feature is used widely in EGL:
- Properties are in effect when a record part or dataItem part is used as a typedef (a model of format). The typedef might be for use by another part, by a variable, or by a structure item that is used in a part or in a variable. The part, structure item, or variable that uses another part as a typedef can override the properties that are in the typedef.
- Properties are also in effect for parts of type dataTable, form, formGroup, library, program, and pageHandler.
No overrides occur for form-level properties. If a property like validationBypassKeys is specified in a form, for example, the value in the form is in effect at run time. If a form-level property is not specified in the form, however, the situation is as follows:
- EGL run time uses the value in the program's use declaration
- If no value is specified in the program's use declaration, EGL run time uses the value (if any) in the form group
Item properties
Each dataItem part and elementary structure item has a diverse set of properties, whether assigned or by default. You also may assign properties to a structure item that has subordinate structure items, but those properties are ignored unless the description of the property says otherwise.
Item properties may be meaningful only in a particular context; for example, when an item interacts with a database table. The properties may have no effect in other contexts, however, as when an item presents data to the screen. The benefit of that lack of effect is that you can re-use the same part declarations. With some exceptions, EGL allows you to maintain values for every item property, in every item.
Most often, you re-use part declarations to create consistency in presentation or validation. You might want several on-screen fields to have the same color, for example, or to restrict input to the same range of numeric values.
With the exception of a series of item properties that are likely to be set only in a form, each item property is in one of these categories:
- Field presentation
- Specifies characteristics that are meaningful when a field is displayed in either of these ways:
- As a field in a printable output, when the destination is a printer or a print file; or
- As a field an on-screen output, when the destination is a command window, but not a Web browser.
The field-presentation properties have no effect on the data that is returned to the program; they are solely for output.
Properties include color and highlight.
For details, see Field-presentation properties.
- Formatting
- Specifies characteristics that are meaningful when data is presented as a printable output, is presented to an on-screen display, or is returned from an on-screen display. The display can be a command window, or a Web browser.
The formatting properties affect data at output or at both input and output. Properties include align, which determines how data is placed in a field.
Any formatting property can be specified on a data item.
For details, see Formatting properties.
- page item
- Specifies characteristics that are meaningful when an item is declared in a PageHandler part.
Properties include value, which indicates the initial content of a data item.
For details, see Page item properties.
- SQL item
- Specifies characteristics that are meaningful when an item is used in an SQL record part. Properties include key, which indicates whether the specified field corresponds to a key column in the related database table.
For details, see SQL item properties.
- Validation
- Specifies characteristics that restrict what is accepted from the user who is working at a command window.
Properties include range, which specifies a high and low value for numeric input.
Any formatting property can be specified on a data item.
For details, see Validation properties.
Other form-specific properties are described in Form part in EGL source format.
Declaration properties
Each item, record, or static array has the property initialized, which indicates whether the memory area is assigned an initial value. The property itself has the value yes or no.
Each dynamic array has the property maxSize, which indicates the maximum number of elements in the array. For details, see Arrays.
Syntax for specifying properties and their overrides
Properties and their overrides are treated consistently in the EGL syntax:
- Each set begins with a left curly bracket ({), includes either an entry or a list of entries that are separated by commas, and ends with a right curly bracket (})
- A property whose valid values are yes and no (isReadOnly, for example) can be expressed in any of three ways:
isReadOnly isReadOnly = yes isReadOnly = noIf you include the name of such a property without explicitly stating a value, the value is yes. If you include neither the property name nor the value, however, the default varies by property. The default for isReadOnly, for example, is no.
The next example shows an SQL record part declaration, which includes two record properties:
Record myRecordPart type SQLRecord { tableNames = myTable, keyItems = myKey } myKey CHAR(10); myOtherKey CHAR(10); myContent CHAR(60); endThe next example shows a variable declaration that uses the previous part as a typedef and that overrides one of the two record properties:
myRecord myRecordPart {keyItems = myOtherKey};The next example shows the same variable declaration, which also overrides a property of a record item:
myRecord myRecordPart {keyItems = myOtherKey, myOtherKey {isReadOnly}}Syntax for overriding item properties in a record
In a record or record-part declaration, you can override the properties of record items. The syntax is in the following format, with each level of information nested within the previous level:
item name1 { item name2 { properties for the nested item } }Properties may be nested as deeply as the structure of the record is nested, and the names of intermediate levels must be supplied either by qualification or by additional nesting.
The following example shows a basic record part for use in a page handler:
Record myRecordPart01 type basicRecord 10 item1; 15 item2; 20 item3 char(4) {displayUse = button, action = "label1"}; 10 item4; 15 item5; 20 item6 char(4) {displayUse = button, action = "label2"}; endAlternatively, that record part can be defined as follows:
Record myRecordPart01 type basicRecord // nesting properties by multiple levels of nesting { item1 { item2 { item3 {displayUse = button, action = "label1"}}}, // nesting properties by qualifying the item names item4.item5.item6 {displayUse = button, action = "label2"} } 10 item1; 15 item2; 20 item3 char(4); 10 item4; 15 item5; 20 item6 char(4); endFinally, the next example shows a variable declaration where the properties for item3 and item6 are overridden:
myRecord myRecordPart01 // nesting properties by multiple levels of nesting { item1 { item2 {item3 { action = "label3"}}}, // nesting properties by qualifying the item names item4.item5.item6 { action = "label6"} }
Related concepts
PageHandler part
Page Designer support for EGL
Typedef
Related reference
Arrays
Field-presentation properties
Formatting properties
Form part in EGL source format
Data initialization
Page item properties
SQL item properties
Validation properties