Form field properties

You can specify field level properties for fields in both text forms and print forms. The following table shows the types of form fields for which you can specify each property. In many cases you specify these properties on data items that you use as types for form fields.

The properties are informally categorized into the following usages:
Format (F)
Affects the way the contents of the variable are formatted on input.
Presentation (P)
Affects the way the contents of the variable are displayed or printed on output.
Validation (V)
Used to screen input for the variable.

These categories are loose and non-exclusive. The align property, for example, affects both input formatting and display, although the effect on input is considered primary.

Note also that the properties do not have any effect during runtime processing. If you move the data from a STRING variable to a CHAR(20) variable with align = right, the data does not itself become right-aligned; it merely prints or displays as right-aligned. (For an easy way to right-align data, see Right-justifying a character variable.)

Following the table, individual sections explain the properties that apply to fields in the various types of forms, starting with the most general (those you can use on any form) and working down to the most specific (those that apply to, for example, text form variable fields only).

Table 1. Field level property usage
Property Usage Valid for text form Valid for print form
Constant Variable Constant Variable
align F   Yes   Yes
color P Yes Yes    
currency F   Yes   Yes
currencySymbol F   Yes   Yes
dateFormat F   Yes   Yes
detectable P Yes Yes    
fieldLen F/P Yes Yes Yes Yes
fill V   Yes    
fillCharacter F   Yes   Yes
highlight P Yes Yes Underscore only Underscore only
inputRequired V   Yes    
inputRequiredMsgKey V   Yes    
intensity P Yes Yes    
isBoolean F   Yes    
isDecimalDigit V   Yes    
isHexDigit V   Yes    
lowerCase F   Java™ only    
masked F   Yes    
minimumInput V   Yes    
minimumInputMsgKey V   Yes    
modified P   Yes    
needsSOSI V   Yes    
numericSeparator F   Yes   Yes
outline P Yes Yes Yes Yes
protect P Yes Yes    
sign F   Yes   Yes
timeFormat F   Yes   Yes
timestampFormat F   Yes   Yes
typeChkMsgKey V   Yes    
upperCase F   Yes    
validationOrder V   Yes    
validatorDataTable V   Yes    
validatorDataTableMsgKey V   Yes    
validatorFunction V   Yes    
validatorFunctionMsgKey V   Yes    
validValues V   Yes    
validValuesMsgKey V   Yes    
zeroFormat F   Yes   Yes

For any field

The following properties are useful for any field—constant or variable—on a text or print form:

Table 2. Properties for any field
Property Description
fieldLen Specifies the number of single-byte characters that can be displayed. Optional.
position Specifies the a row and column number for the beginning of a form field. Required.
value Identifies a string literal that is displayed as the field content. Optional.

For any variable field

For a variable field on a text or a print form, you can specify most of the formatting properties (marked with an "F") in the "Field level property usage" table above. See the table for specifics; for example, lowerCase operates on input only, so has no effect on print forms.

For variable field arrays

EGL supports one-dimensional arrays on text and print forms. Declare an array by placing the number of elements in brackets after the variable name. This value must be greater than 1 (otherwise you are declaring a simple variable and not an array):
  myArray char(1)[3];	

EGL positions the elements of the array based on the position you specify for the first element in the array. By default, EGL positions the elements vertically on consecutive rows.

Use the following properties to vary the default behavior:

Table 3. Properties for variable field arrays
Property Description
columns Specifies the number of columns in which to display the elements of a variable field array.
indexOrientation Specifies how the program displays the elements of an array.
linesBetweenRows Specifies the a row and column number for the beginning of a form field.
spacesBetweenColumns Specifies the number of spaces separating each column of elements from an array field.
You can override properties for an array element. In the following field declaration, for example, the cursor property is overridden in the second element of myArray:
  myArray char(10)[5]	
    {position=[4,61], protect=skip, myArray[2] {cursor = yes} };

For text form fields

The following properties are useful on text form fields:

Table 4. Properties for text form fields
Property Description
cursor Indicates whether the cursor is at the beginning of the field when the form is first displayed.
detectable Enables field detection with a light pen (COBOL) or mouse (Java).
protect Prevents users from changing the value of the field.

In addition, any field on a text form (variable or constant) can take any of the presentation properties (marked with a "P") in the "Field level property usage" table above.

For variable fields on text forms

The following properties are useful for variable text fields:

Table 5. Properties for text form fields
Property Description
modified Marks the field as changed.
validationOrder Indicates the position of the field in the validation order.

In addition, a variable field on a text form can take any of the validation properties (marked with a "V") in the "Field level property usage" table above.

For print form fields

Any field on a print form, variable or constant, can take the following presentation properties:

Table 6. Properties for print form fields
Property Description
outline Draw lines at the edges of fields.
highlight Specifies an underline for the field.

For variable fields on print forms

There are no properties specific to print form variables.


Feedback