开发者

How to display table in COBOL's SCREEN SECTION?

开发者 https://www.devze.com 2022-12-20 09:36 出处:网络
For learning purposes I am trying the following: I am trying to display a table via COBOL ... I want to define the way it is all displayed in the SCREEN SECTION.

For learning purposes I am trying the following: I am trying to display a table via COBOL ... I want to define the way it is all displayed in the SCREEN SECTION.

Following happens or is supposed to happen - all without multiple screens opening:

(1) User enters ENTRY-SCREEN
(2) User has to type in a password (nothing happens there yet ... I am going   
    step by step)
(3) User hits ENTER and gets 开发者_运维知识库to the MAIN MENU
    (3.1) User hits "D" --> List of states and abbreviations is displayed
    (3.2) User hits "S" --> User gets to screen where he can look up state-name  
          by entering abbreviation.
(4) By pressing F2 the user can go back to the MAIN MENU
(5) By pressing F1 the user can exit the program

My problem is 3.1 without opening a new screen and without having to define a line and column definition for each state. Is there a way - maybe with a loop or with THRU - to make this easier and maybe even define this in the screen section? Like:

PERFORM VARYING counter FROM 1 BY 1 UNTIL counter > 50
*<Display the abbreviation and state-name w/o opening new screen>
END-PERFORM.


You can do this by defining the line to be displayed in the Screen Section with a variable line number, which itself is defined separately in working-storage.

Using a loop, in the procedure division, you can display each line by adding 1 to your line variable, display the line, and repeat.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号