I'm building a cobol system and I can't display an error message to the user using the screen section. How can I do this?
And how do I get the ESC key that the user presses to return to the menu?
I'm using GNUCobol and OpenCobol.
I'm building a cobol system and I can't display an error message to the user using the screen section. How can I do this?
And how do I get the ESC key that the user presses to return to the menu?
I'm using GNUCobol and OpenCobol.
Here comes a very brief example of how you can use screen section in cobol.
*>****************************************************************
*> Author:mnemonics
*> Date:
*> Purpose:
*> Tectonics: cobc
*>****************************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. using-screen.
DATA DIVISION.
FILE SECTION.
WORKING-STORAGE SECTION.
01 id-in-ws pic x(4).
screen section.
01 id-input line 5 col 10 pic x(4) to id-in-ws.
01 id-input-fld line 5 col 5 value "id: ".
PROCEDURE DIVISION.
MAIN-PROCEDURE.
DISPLAY id-input-fld
accept id-input
STOP RUN.
END PROGRAM using-screen.
Observe the section screen. You have to declare variables that will represent the fields inside the encapsulation of the screen section. The inserted value will be stored in the variable declared under the working-storage section. A great article about how to use screen can be read in the following web page: Using screens in COBOL.