ContentsIndexPreviousNext

4.3.2.1 The KEYBOARD variable

You can specify one or more KEYBOARD 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:

KEYBOARD keyword=value [keyword=value]...

Keywords are:

1. AUTO-RETURN=value

Some ACCEPT statements terminate automatically when the input field is filled. When this occurs, the termination key value is the value (a decimal number) defined by the AUTO-RETURN keyword. This value is returned in the CONTROL KEY clause of the ACCEPT statement. The default value is zero. You may also specify this option with the configuration variable KBD-AUTO-RETURN.

2. CASE=value

The CASE option on the KEYBOARD configuration entry allows you to cause all entries to be automatically converted to upper or lowercase. Value may be set to "Upper", "Lower" or "Both":

Upper all ACCEPT statements convert keystrokes to upper case.

Lower all ACCEPT statements convert keystrokes to lowercase.

Both (default) causes no translation.

CASE may be overridden with the "UPPER" and "LOWER" keywords on individual ACCEPT statements. The configuration variable KBD-CASE is also supported.


Note that setting environment KEYBOARD CASE=UPPER does not work with entry fields. However, you can achieve the same effect by using the UPPER phrase on the ACCEPT statement.
3. CHECK-NUMBERS=value

Normally, ACUCOBOL-GT requires that numeric data be entered for numeric and numeric-edited fields that have the CONVERT phrase specified for them. If value is "No", then any data can be entered and the runtime system will remove the non-numeric data from the user's input prior to converting. If value is set to "Yes" (the default), then a non-numeric entry will cause an error message to print and will force the user to re-enter the field. If value is set to "Validate", the runtime also checks to make sure that the numbers entered are valid, as described by the PICTURE clause for that field. The configuration variable KBD-CHECK-NUMBERS can also be used to set this value.

4. CURSOR-PAST-END=value

By default, ACUCOBOL-GT does not let the cursor leave the field where data is being entered. When the final position is entered, the cursor remains there and further entry is inhibited except for editing keys. Setting value to "Yes" allows the cursor to move one character past the end of the field instead. Input is still inhibited. The difference between the two modes is essentially cosmetic and CURSOR-PAST-END can be set to suit the user's taste. The default value is "No". This value may also be specified with KBD-CURSOR-PAST-END.

5. DATA-RANGE=value

Value defines the range of legal ASCII input values. Any character received that falls outside of this range will not be accepted into the input field, but may define other actions such as field editing or input termination. Two decimal numbers, separated by a comma, express the lower and upper bounds of the range. The maximum range is "1,255". The default range is "32,255". This value may also be set using the configuration variables KBD-DATA-RANGE-HIGH and KBD-DATA-RANGE-LOW.


Note: If the same number(s) are included in both the SATA-RANGE and EXCEPTION-RANGE, then the DATA-RANGE takes precedence.
6. EXCEPTION-RANGE=value

This is similar to the DATA-RANGE keyword except that value defines the range of characters that generate default exception handling. A key whose ASCII value falls within that range will terminate input with an exception condition value which matches the ASCII value of the key. That value is returned in the EXCEPTION clause or the CONTROL KEY clause of the ACCEPT statement. The default range is "1,31". A character in this range that is also defined by a KEYSTROKE variable acts as defined by that KEYSTROKE variable, and may or may not terminate the input. The configuration variables KBD-EXCEPTION-RANGE-HIGH and KBD-EXCEPTION-RANGE-LOW may also be used to set this value.


Note: If the same number(s) are included in both the SATA-RANGE and EXCEPTION-RANGE, then the DATA-RANGE takes precedence.
7. IMPLIED-DECIMAL=value

If value is "Yes", an implied decimal point is inserted in certain fields when the user does not explicitly type a decimal point. The last n digits of the user's input will be to the right of the decimal point, where n is the number of decimal places specified in the receiving field. For example, if the program is accepting a field with two decimal places, and the user types "1535", the value accepted (and echoed to the screen) will be "15.35". This is only done for numeric or numeric-edited fields that are input with conversion, either explicit or implicit. It never occurs for floating-point items. The default value is "No". The configuration variable KBD-IMPLIED-DECIMAL is also supported.

8. RM-2-DEFAULT-HANDLING=value

RM/COBOL versions 2.1 and 2.2 have a configuration option that allows for ACCEPT fields that do not receive any input (e.g., the user just types Return) to leave the receiving field unchanged. Normally, the receiving field would be filled with spaces. If the RM-2-DEFAULT-HANDLING value is "Yes", then ACUCOBOL-GT will behave in this alternate fashion. You may also set this value using the variable KBD-RM-2-DEFAULT-HANDLING.


Note: This option is recommended only if you are converting programs written using this feature of RM/COBOL. Note that RM/COBOL-85 does not contain this feature, so only programs written for RM/COBOL version 2 should need to use it.
9. SCREEN-DEFAULT=value

If value is "Yes", default data is taken from the screen for any ACCEPT statement that does not have a default value specified for it (either explicitly or implicitly). This will also allow for updating of the current screen contents. The default value is "No". This option can also be specified using the configuration variable KBD-SCREEN-DEFAULT.