Cursor: How to Hide in Accept Mode

0 Likes

This article describes how to hide the cursor when using an ACCEPT OMITTED statement.

Problem:

Is it possible to hide the cursor in an ACCEPT statement?

Resolution:

The cursor may be hidden by using the runtime configuration variable: CURSOR_MODE

This variable can assume one of these values:

1 (always visible)

2 (always invisible)

3 (invisible except during ACCEPT statements, then visible)

The default value is 3.

Note that this variable has a global effect over the whole application, so it is advisable to set it programmatically when needed.

The program sample below shows how to do this and how to restore the default value.

       identification division.
program-id. prog.
author. claudio.contardi@microfocus.com.
remarks.
environment division.
special-names.
decimal-point is comma.
input-output section.
file-control.
data division.
file section.
working-storage section.
77 default-font handle of font.
77 h-wind handle of window.
LINKAGE SECTION.
SCREEN SECTION.
procedure division.
main-logic.

display standard graphical window lines 30 size 80
height-in-cells width-in-cells color 65793
title "Hide the cursor" auto-minimize handle in h-wind
no wrap control font default-font.


display "This sample shows how to hide the blinking cursor --"
- "->" line 4

ACCEPT OMITTED

SET ENVIRONMENT "CURSOR_MODE" TO 2

display "Now the cursor is here but it's not visible --->"
line 6

ACCEPT OMITTED

display "Resetting CURSOR_MODE to 3 makes the cursor appear"
- "r again --->" line 8

SET ENVIRONMENT "CURSOR_MODE" TO 3

ACCEPT OMITTED line 8 col 65

display "Bye!" line 10

ACCEPT OMITTED

stop run.

Incident Number: 2281441

Old KB# 14348
Comment List
Related
Recommended