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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

function keys

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi to all
i have an idea for a project using cobol language but i encoutered a problem and didnt find anything about it in the references i use.
what is the syntax for using function keys with Rmcobol-85?
example: press F1 to search the file
press F2 to print the file
press F3 to go to a certain menu
. . .
. . .
. . .
press Esc to exit.

please if any one knows inform me, i really need this information.
E-mail: hassanieh@yahoo.com


 
What you may want to use is ON EXCEPTION clause of the ACCEPT statement. See the RM/COBOL Language Reference Manual for more details.

01 WS-EXC PIC 99.
88 F1 Value 01.
88 F2 Value 02.
88 ESC Value 27.
01 WS-X PIC X.
PROCEDURE DIVISION.
A.
Display "Press Function Key F1 or F2 or ESC "
Line 5 Col 1 Erase.
Perform until ESC
Accept WS-X Line 5 Col 36 PROMPT NO BEEP
ON EXCEPTION WS-EXC
EVALUATE TRUE
When F1
Display "Function 1 "
When F2
Display "Function 2 "
When ESC
Display "Escape Key "
End-Evaluate
NOT ON EXCEPTION
Display "Key Entered " WS-X col 0
End-Accept
End-Perform.
Stop Run.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top