ContentsIndexPreviousNext

4.4.2 The SCREEN Option

There is a runtime configuration variable called "SCREEN" that controls many features of the video sub-system. This option works in the same manner as the "KEYBOARD" variable. You can specify one or more SCREEN variables. Attributes that you can set are identified by one or more sets of keywords and associated values, separated from each other by spaces or tabs; the syntax is:

SCREEN keyword=value [keyword=value]...

The following keywords are supported:

1. ALPHA-UPDATES=value

This option affects how alphanumeric fields with a default value are displayed prior to entry. It works just like the EDITED-UPDATES option (described below) except that it applies to alphanumeric fields instead of numeric edited fields. The only acceptable value is Unchanged.

Placing "Auto-Prompt" immediately after this option, using a comma as a separator, allows the user to decide whether to change or replace the default value. When Auto-Prompt is specified, the default value will be displayed, and then the program will wait for the user to enter a character. If the character entered is a data character, ACUCOBOL-GT will fill the field with prompt characters (erasing what was there) and then accept data as if this were a new field. If the character entered is an editing character (such as an arrow key), then ACUCOBOL-GT allows the user to edit the data normally. Sample syntax is shown here:

SCREEN  ALPHA-UPDATES=Unchanged, Auto-Prompt

This option can also be specified as SCRN-ALPHA-UPDATES. The Auto-prompt value can be specified with SCRN-ALPHA-AUTO-PROMPT. For example, to set the above syntax using these variables, you would enter:

SCRN-ALPHA-UPDATES Unchanged
SCRN-ALPHA-AUTO-PROMPT on

2. CONVERT-OUTPUT=value

This option affects only Screen Section DISPLAY statements. If this keyword is set to "Yes", then all output fields will act as if the WITH CONVERSION phrase were specified for them. This has two effects. The first is that numeric fields will be converted from the internal storage format to a readable form (including suppression of leading zeros). The second is that the action of the JUSTIFY keyword (see below) takes effect. This option is normally set to "No", but is provided as an alternate method of displaying numeric data in the Screen Section. The configuration variable SCRN-CONVERT-OUTPUT is synonymous with this option.

3. EDITED-UPDATES=value

This option affects how numeric edited fields with a default value are displayed prior to the user making an entry. The four possible values are: Converted, Unchanged, Left-Adjust, and Formatted.

Converted is the default setting. When this setting is used, the default value is displayed in a standardized format. This format has an optional leading minus sign, followed by the number, with no leading zeros and no internal formatting characters.

Unchanged is an alternate setting. When this setting is used, the default value is displayed without any changes. All of the editing characters appear, and leading spaces are shown. Note that the LEFT, RIGHT, or CENTER phrase will affect the display. After the value has been displayed, the user can edit it normally.

Left-Adjust is identical to Unchanged, except that any leading spaces are removed before the value is displayed.

Formatted is fundamentally different from the other options in that it affects the way the number is entered, not just the format of the default value. When "Formatted" entry is selected, the number is continuously reformatted by the ACCEPT statement to match the editing specification of the item being entered. This means that the value will always appear to the user in its "final" form. This is similar to the way numbers are entered on most calculators. Selecting this option has many minor affects on the actions of various editing keys. These are not detailed here, but the actions of the editing keys are analogous to their actions on non-formatted fields.

There is one exception to the rule that the number will always be formatted just as described by the PICTURE clause. This is when "Z" or "*" characters are placed after the decimal point in the PICTURE. In this case, the entered characters will be treated like "9" characters instead. This is necessary in order to allow the user to enter values between zero and 1 when the default value is zero. If this rule did not exist, then when the user tried to enter the decimal point, the reformatter would keep removing it. The same applies to any zero digits between the decimal point and the first non-zero digit.

When the "Formatted" option is used with left justification, the entry action is also left justified. When it is used with the centering option, the entry occurs as if the field were right justified, and the final result is centered when the user leaves the field.

Place "Auto-Prompt" immediately after this option, using a comma as a separator, to allow the user to decide whether to change or replace the default value. When Auto-Prompt is specified, the default value will be displayed, and then the program will wait for the user to enter a character. If the character entered is a data character, ACUCOBOL-GT will fill the field with prompt characters (erasing what was there) and then accept data as if this were a new field. If the character entered is an editing character (such as an arrow key), then the program allows the user to edit the data normally. Sample syntax is shown here:

SCREEN EDITED-UPDATES=Converted, Auto-Prompt

This option can also be specified as SCRN-EDITED-UPDATES. The Auto-prompt value can be specified with SCRN-EDITED-AUTO-PROMPT.

4. ERROR-BELL=value

This option determines when the error bell will be sounded. Possible values are:

Yes: ring the bell on an entry error, but not on field-full. This is the default setting.

No: do not ring the bell on entry error or field-full.

All: ring the bell whenever the user makes an entry error or attempts to enter data into a full field.

For example, to use the "All" setting, add the following line to your runtime configuration file:

SCREEN  ERROR-BELL=All

You may also use the configuration variable SCRN-ERROR-BELL to set these values. The variable SCRN-WARN is synonymous with SCREEN ERROR-BELL=All.

5. ERROR-BOX=value

This option affects whether an error box appears when an entry error has occurred. Examples of entry errors are entering a letter in a numeric field or entering a number in the wrong format. When value is set to "yes" (the default), the error message is displayed in a box. If value is set to "no", the error is reported based on the entry in the SCREEN ERROR-LINE variable (below). The configuration variable SCRN-ERROR-BOX may also be specified.

6. ERROR-COLOR=value

This keyword is given a numeric value that represents the colors used in error messages generated by the runtime system. Value is the arithmetic sum of the numbers representing the colors and other attributes used in error messages generated by the runtime system. The following color values are accepted:

Color
Foreground
Background
Black
1
32
Blue
2
64
Green
3
96
Cyan
4
128
Red
5
160
Magenta
6
192
Brown
7
224
White
8
256

You may specify other video attributes by adding the following values:

Reverse video
1024
Low intensity
2048
High intensity
4096
Underline
8192
Blink
16384
Protected
32768

Only one foreground color and one background color may be specified. If either is missing, the corresponding default for the current terminal window is used. High intensity and low intensity may not both be specified. If neither is specified, the default intensity is used.

For example, to get a blinking white foreground on a blue background, you would specify:

  SCREEN   ERROR-COLOR=16456

(16456 = 8+64+16384)

The default value is "4096", which causes the error messages to use the current colors with a high-intensity foreground. The configuration variable SCRN-ERROR-COLOR is also supported.

7. ERROR-LINE=value

Value is the line number you wish error messages to appear on. The runtime system pops up a one-line window on this line to display the message, and then removes it after the user responds. If this is set to a negative value, then the line used will be that many lines up from the bottom of the screen. For example, "Error-Line=-2" implies that the next-to-last line should be used. The default value is "-1". You may also specify the configuration variable SCRN-ERROR-LINE to set this value.

8. FORM-FEED=value

This option lets you use "Control-L" for a form feed. Setting this variable to "yes" and putting "Ctl-L" in a DISPLAY statement allows a form feed to occur. In effect, this clears the screen and puts the cursor at screen position (0,0). Setting this variable to "no" disallows a form feed. The default value is "no". This can also be specified as SCRN-FORM-FEED instead of SCREEN FORM-FEED.

9. INPUT-DISPLAY=value

This option determines what happens when the DISPLAY verb operates on an input field described in a Screen Section entry. There are four choices: "None", "Value", "Spaces", and "Prompt".

None: The field is not displayed.

Prompt: The field is displayed with the field's prompt character (usually underscore).

Spaces: The field is displayed as spaces. This is the default value.

Value: The current value of the field is displayed. This will be zero for numeric and numeric-edited fields, and spaces for other fields.

The configuration variable SCRN-INPUT-DISPLAY is also supported.

10. INPUT-MODE=value

This option affects pre-display of data in a Screen Section ACCEPT. The options are "Predisplay", "Update", and "Normal".

Predisplay: A Screen Section ACCEPT statement will cause the current value of each input and update field to be displayed. (Whatever is present in the Screen Section is displayed; this is not necessarily the same as the contents of Working-Storage). Each field is then entered as an update field (i.e., the value can be edited).

Update: Each input field is treated as an update field. This causes the field's current value to echo on the screen when the field is visited.

Normal: Causes no echoing of input-only fields.

You may also specify the configuration variable SCRN-INPUT-MODE.

11. JUSTIFY=value

The JUSTIFY setting determines the default justification of converted numeric and numeric-edited fields. If "Left" is chosen, then leading spaces are removed from these fields when they are displayed. If "Right" is chosen, then the leading spaces are retained. Finally, if "Auto" is chosen (the default), then left justification is used if the program was compiled in RM/COBOL compatibility mode, otherwise right justification is used. Note that justification affects only fields that have the CONVERT phrase specified or implied for them. The configuration variable SCRN-JUSTIFY is also supported.

12. NUMERIC-UPDATES=value

This option affects how numeric fields with a default value are displayed prior to entry. This option works just like the "EDITED-UPDATES" option described above except that it applies to numeric fields instead of numeric edited fields. The possible values are Converted and Unchanged.

Place the phrase Auto-Prompt immediately after this option, using a comma as a separator, to allow the user to decide whether to change or replace the default value. When Auto-Prompt is specified, the default value will be displayed, and then the program will wait for the user to enter a character. If the character entered is a data character, ACUCOBOL-GT will fill the field with prompt characters (erasing what was there) and then accept data as if this were a new field. If the first character entered is an editing character (such as an arrow key), then ACUCOBOL-GT allows the user to edit the data normally. Sample syntax is shown here:

SCREEN NUMERIC-UPDATES=Converted, Auto-Prompt

This option can also be specified as SCRN-NUMERIC-UPDATES. The Auto-prompt value can be specified with SCRN-NUMERIC-AUTO-PROMPT.

13. PROMPT=value

The value of the PROMPT setting determines the default prompt character. The default value is underscore. To specify an alternate prompt, place the character immediately after the equals sign. To specify a space as the prompt character, leave the value empty (e.g., "Prompt= "). You may also specify the configuration variable SCRN-PROMPT to set this value. The variable SCRN-PROMPT-DEFAULT is equivalent to setting SCREEN PROMPT to the default value.

14. PROMPT-ALL=value

By default, a prompt character is shown only in the field containing the cursor. If value is "Yes", then the prompt character is shown in every field managed by the ACCEPT statement. The prompt characters are removed when the ACCEPT is terminated. Prompts never appear in SECURE fields. Default is "No". The configuration variable SCRN-PROMPT-ALL is synonymous with this option.


Note: Setting the SCREEN keyword PROMPT-ALL to the value "Protected" will have the same effect as setting PROMPT-ALL to "Yes", except that prompt characters will not be displayed in protected fields.
15. PROMPT-ATTR=value

You may specify a prompt attribute. This attribute is used whenever the PROMPT is specified or implied for an ACCEPT statement. The attributes that you can specify are the same as those for the COLOR-MAP runtime configuration variable described in section 4.4.1. The configuration variable SCRN-PROMPT-ATTR is also supported.

16. REFRESH-LINES=value

Value specifies the number of screen lines to redisplay after the user has finished entering data into a field. This option is useful when the terminal or terminal emulator can accept Asian phonetic characters and translate them into ideograms. The entered characters will often overflow the displayed input field, but after translation, the resultant ideogram(s) will not. This option will "clean up" the screen by redisplaying the affected lines with the ideograms in place. For example:

SCREEN   REFRESH-LINES=3

After accepting input data, the Terminal Manager will redisplay the contents of the input field, the remainder of the line, and the two lines below it.

If the CODE-SYSTEM runtime configuration variable (see section 4.4.4) is non-zero, specifying an Asian double-byte character system, the default value of REFRESH-LINES is "1". If the CODE-SYSTEM runtime configuration variable is set to "0", indicating a single-byte ASCII or EBCDIC character system, the default value of REFRESH-LINES is "0". You may also use the configuration variable SCRN-REFRESH-LINES to set these values.

17. REFRESH-MODE=value

This option, like REFRESH-LINES, supports double-byte character sets. Value specifies when lines should be refreshed after an ACCEPT. Setting this variable to a value of "0" means that the lines are never refreshed, "2" indicates that lines are always refreshed. The default value of "1" specifies that lines are refreshed only if double-byte characters are entered. For example:SCREEN REFRESH-MODE=1

The configuration variable SCRN-REFRESH-MODE is synonymous with this option.

18. SHADOW-STYLE=value

This option determines the way window shadows are displayed. It may have one of the following four values:

None: When this setting is used, shadows are not displayed.

Dim: This setting displays a one-character border around the right and bottom edges of the window. This border displays the underlying data in low-intensity with a white foreground and a black background; in effect, the border is translucent. This border looks best when the shadowed window and the window it overlays do not both have black backgrounds.

Black: This setting displays a black border on the right and bottom edges of the window. On the right edge, this border is one character wide. On the bottom edge, the border is one-half character high. This gives a fairly uniform appearance to the border. The border depends on the existence of an "upper-half" block character on the display device. For machines that use a terminal database file, this character should be specified as the 12th character in the GM code in the terminal database file (GM defines the various graphics characters). Also, we recommend that you specify a "lower-half" character as the 13th GM character. If such characters do not exist, then the bottom border is a full character high. The Black setting is the default shadow style.

Lines: This setting causes the right and bottom edges to be shown with a border made from the line drawing set. This setting is not as appealing as the Dim or Black settings when color or reverse-video backgrounds are being used. When the background is black, however, this setting is preferable to the other two.

The configuration variable SCRN-SHADOW-STYLE is also supported.

19. SIZE=value

This keyword has meaning only on graphical systems such as Windows. It is used to change the default virtual screen size. Value is the desired number of rows and columns, separated by a comma.

For example, to set the initial virtual screen size to 30 rows by 80 columns, you would make the following entry:

SCREEN    SIZE=30,80

The comma is required.

The size of your virtual screen is independent of the size of the application window or the underlying hardware. In other words, the virtual screen can be larger than the physical screen. You may set any screen size up to a maximum of 100 rows and 200 columns. If you do not specify a size, the default is 25 rows and 80 columns. You may also use the configuration variables SCRN-SIZE-COLS and SCRN-SIZE-ROWS to set this option.


Note that the SIZE option sets only the initial screen size. After the application begins, the screen size can be changed with the DISPLAY SCREEN SIZE verb.

Caution: If the virtual screen is too large to be fully displayed on the physical screen, the user will have to scroll to view all of the rows and columns.
20. WINDOW=value

This keyword has meaning only on graphical systems such as Windows. Normally, the initial size of an application's window is determined by the host. You can change this initial size with the WINDOW keyword. Value is the desired number of rows and columns, separated by a comma.

For example, if you wanted your initial window to contain 10 rows and 70 columns, you would enter:

SCREEN   WINDOW=10,70

The WINDOW configuration option has several special values that it recognizes. If either the row or column is set to a negative number, then the initial window is minimized (turned into an icon). If either value is set to "999" or larger, then the initial window is maximized instead. Finally, if either value is zero, then the initial window size is determined by the host system (this is the default).

The application window size may never be bigger than the virtual screen size, nor may the window size be larger than what can be physically displayed on the user's screen. This physical limit will change depending on the resolution of the user's screen and the size of the font you are using. The ACUCOBOL-GT runtime will automatically reduce the requested window size to meet these limits.

You may enter the SIZE and WINDOW options on the same line. For example, if you wanted your application to be able to use 30 lines by 80 columns, and you wanted to start with the window maximized (thus showing the entire virtual screen), you would enter:

SCREEN   SIZE=30,80   WINDOW=999,999


Note that the SIZE and WINDOW options set only the initial screen and window size. After the application begins, the user is free to change the window size with various system controls, and the application is free to change the screen size with the DISPLAY SCREEN SIZE verb.
The configuration variables SCRN-WINDOW-X and SCRN-WINDOW-Y are also supported for this option.

More:

4.4.2.1 SCREEN examples