×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

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

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

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

(OP)
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.

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

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close