API_NC GETCH
ve3wwg edited this page Oct 12, 2014
·
1 revision
This API waits for the user to type at least one character before returning to the caller. Either a special key code is returned in NC-KEY-CODE or a character is returned in NC-KEY-CHAR. When 88 level item IS-KEY-CODE is true, the value is returned in NC-KEY-CODE instead of NC-KEY-CHAR.
Key codes are defined in the copy book COBCKEYS.
PERFORM NC-GETCH
None.
01 NC-COBCURSES. 10 NC-KEY-DATA. 20 NC-KEY-CODE-FLAG PIC X(1). 88 IS-KEY-CODE VALUE 'Y'. 20 NC-KEY-CODE PIC 9999 COMP-5. 20 NC-KEY-CHAR PIC X.
- Value is in NC-KEY-CHAR when IS-KEY-CODE is false.
- Value is in NC-KEY-CODE when IS-KEY-CODE is true.
- Key codes are defined in copy book COBCKEYS.
RETURN-CODE | Notes |
---|---|
NC-RET-OK | Successful |
- Avoid referencing the value NC-KEY-CODE-FLAG for maximum portability to future versions of CobCurses. Use the 88 level item instead.
Return to the COBCURSQ API Index.