Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COB-SCN-KEY-UP NOT WORKING IN GNU 3.2 PROGRAM WIN10

Status
Not open for further replies.

RichL32

Programmer
Dec 17, 2023
11
0
0
US
I'm having trouble getting the cursor-up key to be recognized in my programs. I found a sample program that helped me to get the escape key to work using ENVIRONMENT variables (COB_SCREEN_ESC etc.), and the 78 level constant COB-SCR-ESC in the screenio copybook, but the COB-SCR-KEY-UP does not work. The sample program works for cursor-up, but only if you do the accept with a direct line/col reference in the command line. Anyone have an answer to this problem? The key-up key feels like it is not enabled, but since it worked in the sample program, it's probably not an enabled issue. I can recode the source for direct reference but I am hoping for a simpler solution if there is one (another environment variable?). Code is listed below for just one of many fields that do not work. I could not find anything useful on the web nor any potential environment variables. Thanks.

SPECIAL-NAMES.
CRT STATUS IS WS-KEY-STATUS.
WORKING-STORAGE SECTION.
01 MISC-ALPHA-FIELDS.
03 WS-PLAYER-NAMES.
05 WS-PLAYER-NAME-4 PIC X(10) VALUE SPACES.
03 SV-X PIC X(10) VALUE SPACES.
01 MISC-NUMERIC-FIELDS.
03 WS-KEY-STATUS PIC 9(04) VALUE ZEROES.

SCREEN SECTION.
** fields in SCREENIO.CPY
78 COB-SCR-PAGE-UP VALUE 2001.
78 COB-SCR-PAGE-DOWN VALUE 2002.
78 COB-SCR-KEY-UP VALUE 2003.
78 COB-SCR-KEY-DOWN VALUE 2004.
78 COB-SCR-ESC VALUE 2005.

01 PLAYER-SCREEN-4.
03 LINE 17 COL 20 VALUE
' PLAYER 4 NAME: '.
03 SC-PLAYER-NAME-4 HIGHLIGHT
LINE 17 COL 46 PIC X(10) USING WS-PLAYER-NAME-4.

PROCEDURE DIVISION.
SET ENVIRONMENT "COB_SCREEN_EXCEPTIONS" TO 'Y'.
SET ENVIRONMENT "COB_SCREEN_ESC" TO 'Y'.
SET ENVIRONMENT "COB_TIMEOUT_SCALE" TO '3'.
SET ENVIRONMENT "COB_EXIT_WAIT" TO "NO".

DISPLAY PLAYER-SCREEN-4.

1350-PROMPT-FOR-PLAYER-NAME-4.
MOVE WS-PLAYER-NAME-4 TO SV-X.

1350-GET-PLAYER-NAME-4.
DISPLAY SC-PLAYER-NAME-4.
ACCEPT SC-PLAYER-NAME-4.

* CHECK FOR ESCAPE KEY
IF WS-KEY-STATUS = COB-SCR-ESC
MOVE SV-X TO WS-PLAYER-NAME-4
DISPLAY SC-PLAYER-NAME-4
GO TO 1380-OPTION-CE.

* CHECK FOR CURSOR-UP KEY
IF WS-KEY-STATUS = COB-SCR-KEY-UP
MOVE SV-X TO WS-PLAYER-NAME-4
DISPLAY SC-PLAYER-NAME-4
GO TO 1340-PROMPT-FOR-PLAYER-NAME-3.
 
I gave up trying to find a simple way to solve the key-up issue and coded the display / accept with a direct line/col reference in the code. "WITH UPDATE" works well to retain the previous contents, otherwise, it will clear it every time on the accept statement.
DISPLAY WS-PLAYER-NAME-1 AT 0746.
ACCEPT WS-PLAYER-NAME-1 AT 0746 WITH UPDATE.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top