如何在 COBOL 的 SCREEN SECTION 中显示表格?
出于学习目的,我正在尝试以下操作: 我正在尝试通过 COBOL 显示表格...我想定义它在 SCREEN SECTION
中的显示方式。
以下发生或应该发生 - 所有这些都无需打开多个屏幕:
(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
我的问题是 3.1,无需打开新屏幕,也无需为每个状态定义行和列定义。 有没有一种方法 - 也许使用循环或使用 THRU
- 使这更容易,甚至可以在屏幕部分中定义它? 喜欢:
PERFORM VARYING counter FROM 1 BY 1 UNTIL counter > 50
*<Display the abbreviation and state-name w/o opening new screen>
END-PERFORM.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过使用可变行号定义要在屏幕部分中显示的行来实现此目的,该行本身是在工作存储中单独定义的。
使用循环,在过程部分中,您可以通过向行变量添加 1 来显示每一行,显示该行,然后重复。
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.