W$GETC

The W$GETC routine retrieves the next keystroke from the user and returns it to the program. The keystroke is not echoed. Use this routine when you require detail management of the keyboard.

In the current implementation, W$GETC does not interact well with event procedures. You should avoid using W$GETC if you use event procedures at the same time. In this case, you can use single character ACCEPT statements instead.

Usage

CALL "W$GETC" 
    USING KEY-FOUND

Parameter

KEY-FOUND PIC X(2)

Description

W$GETC places the keystroke found into its single parameter. If the character is a single 8-bit value, the first character of the return value is a space and the second character is the character typed. For example, if the user types an A, the return value will be a space followed by A.

If the key typed is a special character such as a function key or the operating system's backspace key, W$GETC returns the two-character keycode found in the ACUCOBOL-GT User's Guide Table of keys Topic. For example, if the user types function key 5, the return value will be k5.

Finally, if an end-of-file condition occurs, then W$GETC returns the two-character sequence -1.