Top
NetCOBOL V11.0 CBL Subroutines User's Guide
FUJITSU Software

11.27 CBL_READ_SCR_KEY

The key input is waited, and if the acquired key is a character key, the character is returned. If the key is a key which can be acquired in the CRT STATUS clause, crt-status-key-1 and crt-status-key-2 of the key are returned.

Specification

Parameter data definition
01  key-type     PIC X.
01  key-code     PIC X(2).
01  status-code  PIC S9(4) COMP-5.
Calling format
CALL "CBL_READ_SCR_KEY"
    USING key-type
          key-code
    RETURNING status-code.

Interface

key-type

The type of the input key is set.

  • "1": The input key is activated key, and crt-status-key-1 is "1".

  • "2": The input key is activated key, and crt-status-key-1 is "2".

  • "3": The input key is character key(1 byte).

  • "4": The input key is character key(2 bytes).

  • "9": The input key is deactivated key.

key-code

Detailed information of the input key is set. As for the content of X(4), the reference method is different according to the key-type as follows.

  • key-type is "1" or "2"

    crt-status-key-2 is set on STSCODE.

    01 STSKEY2.

    02 STSCODE PIC 9(4) BINARY.

  • key-type is "3"

    The input character is set on SBCSCODE.

    01 SBCSKEY.

    02 FILLER PIC X.

    02 SBCSCODE PIC X.

  • key-type is "4"

    The input 2-byte-character is set on DBCSCODE.

    01 DBCSKEY.

    02 DBCSCODE PIC X(2).

  • key-type is "9"

    The deactivated key type is set on ERCODE.

    01 INVALIDKEY.

    02 FILLER PIC X.

    02 ERCODE PIC 9(2) BINARY.

  • The deactivated key type is as follows.

    9: The deactivated function key is entered.

Return code

The return code is set in the status-code specified in the RETURNING clause.

status-code
  • 0: Successful

  • Other than 0: Failure

Note

When this routine executes, it is necessary to specify execution environment information @CBR_SCR_KEYDEFFILE beforehand.

If you use this CBL routine with key-type=9, you have to compile your cobol program with compile option "BINARY(BYTE)".