Operation (cont.) [ Micro Focus COBOL System Reference, Volume 1 ] MPE/iX 5.0 Documentation
Micro Focus COBOL System Reference, Volume 1
Operation (cont.)
CONTROL Clause in ACCEPT/DISPLAY Statements
This system supports the CONTROL clause within the WITH phrase of Format
2 of the screen handling ACCEPT and DISPLAY statements, and within Adis
ACCEPT and DISPLAY statements. This clause allows attributes associated
with a Screen Section item to be defined at run time. See your Language
Reference for details of format and syntax.
Adis Configuration
One of the powerful features of Adis is that it can be configured to
tailor the behavior of ACCEPT and DISPLAY statements. Full configuration
is possible using the Adiscf utility (supplied with this product) via the
adisctrl file produced by this utility. The ability to do this is
described in the chapter Adis Configuration Utility (Adiscf).
Adis is designed to operate with no adisctrl file present, using
predefined defaults for all the configurable options. Applications that
operate successfully using these default options can be shipped without
the adisctrl file.
At run time, Adis searches for the adisctrl file in the current directory
and then, if not found, in the COBOL system directory. Unless your
applications all use the same nondefault configuration, you are advised
to work without the adisctrl file, if possible, and only to create it in
the current directory if it is needed.
Remember that during installation, the default adisctrl file is copied to
the COBOL system directory only when the Adis configuration is selected.
If you wish to alter the default configuration, you are advised to move
adisctrl into your current directory before changing it, and not return
it to the COBOL system directory.
On DOS, Windows and OS/2, when the system is installed for Microsoft
COBOL V2.2 operation using Setup, the adisctrl file is loaded
automatically, with the Microsoft COBOL V2.2 configuration selected as
the active configuration. (DOS, Windows and OS/2)
On some UNIX environments you might have been supplied a with cobkeymp
file. If this is the case, it is essential, for correct operation of
ACCEPT statements, that you have this file in the COBOL system directory.
The cobkeymp file is produced by the keyboard configuration Keybcf, which
enables you to configure the behavior of your keyboard. See the chapter
Keyboard Configuration Utility (Keybcf) for more information.(UNIX)
Altering the Adis Configuration from a Program.
The adisctrl file contains a number of predefined Adis configurations.
There is a library routine that your program can use to select which
configuration to use during the execution of extended ACCEPT and DISPLAY
statements. It overrides the configuration selected in Adiscf.
The routine is defined as:
call x"AF" using set-configuration
configuration-name
where set-configuration and configuration-name are defined in the
Working-Storage Section of your program as follows:
01 set-configuration pic 9(2) comp-x value 59.
01 configuration-name pic x(70).
where:
configuration-name is the name that appears on the F6=Choose menu in
Adiscf.
set-configuration contains the value 255 on return from the call if
the name specified in configuration-name is not
found in the adisctrl file.
Adis Run-time Configuration.
This section describes features of Adis that are not available via COBOL
syntax, but can be accessed with the x"AF" COBOL system library routine.
Most of these features can also be set by configuring Adis using Adiscf.
See the chapter Adis Configuration Utility (Adiscf) for more information.
All of these features are accessed by the following call statement:
call x"AF" using set-bit-pairs
parameter-block
where the parameters are defined as follows:
01 set-bit-pairs pic 9(2) comp-x value 1.
01 parameter-block.
03 bit-pair-setting pic 9(2) comp-x.
03 bit-map-section pic x value "2".
03 bit-pair-number pic 9(2) comp-x.
03 filler pic 9(2) comp-x value 1.
The values to be set for the fields bit-pair-setting and bit-pair-number
vary according to the function you want to perform. The required values
for these two parameters are given in each of the descriptions below.
With all x"AF" calls, if an error occurs, set-bit-pairs is set to the
value 255 on return from the call.
The following functions are available using this facility:
* Enable or disable predisplay.
* Enable or disable display of the Adis indicators.
* Enable or disable display of Adis error messages.
* Enable or disable auto-skip between fields.
* Enable or disable input data case conversion.
* Enable or disable password concealment.
* Enable or disable pre-clear and auto-clear.
* Timeout unit selection.
* Timer reset selection.
* Enable or disable screen read on non-FED terminals.
These functions are described in the following sections.
Enable or Disable Predisplay.
This routine enables you to control whether or not the initial contents
of fields are predisplayed before any data entry is allowed when an
ACCEPT statement is executed. This is also controlled by ACCEPT/DISPLAY
option 5 in Adiscf. See the section Altering ACCEPT/DISPLAY Options in
the chapter Adis Configuration Utility (Adiscf) for more information.
This call overrides any value set in Adiscf.
NOTE The predisplay of fields defined as fixed format numeric or
numeric-edited cannot be turned off.
The fields in parameter-block should be set as follows:
bit-pair-number must be set to 76.
bit-pair-setting should be set to one of the following values:
0 Only fixed-format numeric and fixed-format numeric-edited fields
are predisplayed.
1 Only numeric fields and fixed-format numeric-edited fields are
predisplayed.
2 A field is predisplayed as soon as the cursor is moved into it.
3 All of the fields in the ACCEPT operation are predisplayed before
any data entry is allowed. This is the default.
Example.
The following code turns off predisplay of fields for all following
ACCEPT operations:
move 76 to bit-pair-number
move 0 to bit-pair-setting
call x"AF" using set-bit-pairs
parameter-block
MPE/iX 5.0 Documentation