set considerations for Text UI

In the context of Text UI, the EGL set statement allows you to reset all fields in a text or print form or, alternatively, to change properties and characteristics of a field in a text form.

Syntax

Text UI syntax for set statement
formName
The name of a print form whose fields you want to reset, or the name of a text form for which you want to change one or more field properties.
formFieldName
The name of a field within a print or text form.
value
Different values are available for forms and form fields.
For print forms, the only possible value is empty, as described below. (To explicitly set a field to null, use an assignment statement such as myField = null.)
For text forms, the following values are available:
alarm
Causes the terminal to beep when the form appears following the next converse statement.
empty
Clears the entire form:
  • Numeric fields are set to zero.
  • Character fields are set to blanks.
  • Date/time fields are set to the current date or time, and INTERVAL fields are set to zero.
  • Fields of ANY type are set according to the type of their current value; if they do not currently have a value, the set statement has no effect on them.
initial
Resets the entire form to its original contents and attributes, as defined in the form declaration, independent of any changes made by the program.
For form fields, the following values are available:
blink
Causes the text to blink repeatedly. Available only in COBOL generation.
bold
Causes the text to appear in boldface.
cursor
Positions the cursor at the beginning of the specified field.
dim
Causes the field to be appear in lower intensity than normal. Use this effect to deemphasize field contents. In COBOL environments, the value has the same effect as normalIntensity.
empty
Clears the specified field:
  • Numeric fields are set to zero.
  • Character fields are set to blanks.
  • Date/time fields are set to the current date or time, and INTERVAL fields are set to zero.
  • Fields of ANY type are set according to the type of their current value; if they do not currently have a value, the set statement has no effect on them.
full
Sets an empty, blank, or null field to a series of identical characters (based on the fillCharacter field property) before the form is presented. The user must remove all these fill characters to prevent the form returning them to the program. To use the full modifier, the form group must be generated with the setFormItemFull build descriptor option.
An MBCHAR field is considered empty if it contains all single-byte spaces, and the full modifier fills such a field with single-byte characters.
initial
Resets the field to its original contents and attributes, as defined in the form declaration, independent of any changes made by the program.
initialAttributes
Resets the field to its original attributes, as defined in the form declaration. Neither the value nor the type of the field is affected.
invisible
Makes the field text invisible.
masked
Generally used for password fields. In COBOL generation, this is the same as invisible. In Java™, typed input appears as asterisks.
modified
Sets the modified data tag, as described in Modified data tag and modified property.
noHighlight
Removes the effects of the blink, reverse, and underline modifiers.
normal
Has the same effect as the combined normalIntensity, unmodified, and unprotected modifiers.
normalIntensity
Sets the field to be visible, without boldface.
protect
Sets the field so that the user cannot overwrite its contents. See also skip.
reverse
Reverses the text and background colors.
selectedColor
Sets the color field-specific property to the value you specify. The valid values for selectedColor are as follows:
  • black
  • blue
  • defaultColor
  • green
  • magenta
  • red
  • cyan
  • white
  • yellow
In COBOL environments, the black value is not available and defaultColor (usually green) is used instead. For more information about default colors, see color.
skip
Sets the field so that the user cannot overwrite its value and a TAB skips over it.
underline
Displays the characters in the field with underscores.
unprotect
Sets the field so that the user can overwrite its value.

Combining values

You can combine set statement values, inserting a comma to separate options such as cursor and full. Be aware that some values are contradictory or potentially redundant, and that EGL runs each modifier in order, moving left to right.

Here are some requirements for combining values:
  1. If you are initializing a field, choose no more than one of the following values:
    • initial
    • initialAttributes
    • normal
    You can then add any number of the following (though empty is redundant if you chose initial above):
    • cursor
    • empty
    • full
  2. For other fields, you can combine any of the following:
    • Choose any number of the following options:
      • cursor
      • full
      • modified
    • Choose no more than one color option:
      • black
      • blue
      • defaultColor
      • green
      • magenta
      • red
      • cyan
      • white
      • yellow
    • Choose no more than one of the highlight options:
      • blink
      • reverse
      • underline
      • noHighlight
    • Choose no more than one of the protection options:
      • protect
      • skip
      • unprotect

Example

In the following example, the cursor property for the customerName field is reset to its initial value.

set myTextForm.customerName initial, cursor;

Compatibility

Table 1. Compatibility considerations for set and text forms
Platform Issue
COBOL generation
  1. The color black is not available; defaultColor is used instead
  2. The dim modifier has same effect as normalIntensity
  3. The masked modifier has same effect as invisible
  4. For print forms, the set formFieldName full statement is ignored unless the setFormItemFull build descriptor option is set to YES.
Java generation The blink modifier is not available

Feedback